Timeline for How do I write unit tests for legacy code (that I don't understand)?
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 20, 2019 at 1:11 | vote | accept | CommunityBot | ||
Jun 20, 2019 at 0:59 | comment | added | ShapeOfMatter | Regarding Regression Testing: It's not conceptually different from any other testing: What would I want the program to do (or not do) before I claimed to a coworker that it was working? If there's records of new features or recent bugs, those are good places to start. Or just look through the documentation you have and pick something that looks testable. Java has typed functions, which is good. A clear type signature can tell you a lot about what to expect from a function (and can be thought of as a kind of unit test in itself). Checking NULL/empty-string/max-int behavior may also be good. | |
Jun 20, 2019 at 0:54 | comment | added | ShapeOfMatter | I'm still sure that you need to insist on getting in the same room as the the people writing the software, ideally for a couple of days, and probably more than once. I can relate to imposed absurd working situations, but at some point one either needs to risk one's job or accept that you're just a bench-warmer, I guess | |
Jun 19, 2019 at 19:22 | comment | added | user339061 | It was more "What regression tests are useful to a component that presumably works as intended?" Like, if I'm to create tests that are useful, what's useful being totally blind about what works, what doesn't, and how it even works at all? I exist in a vacuum apart from the software team and the people who gave me this task exist in a vacuum apart from both of us. | |
Jun 19, 2019 at 19:10 | comment | added | ShapeOfMatter | I don't know how helpful I can be. Are you having trouble understanding how the test framework works? Are you wondering what to test? For that, regression tests are a good choice: What test would have prevented this bug we just fixed from getting pushed, if we'd been so forsightful. | |
Jun 19, 2019 at 19:04 | comment | added | user339061 | Thanks for the answer! Could you also take a look at the second half of my question too? My first half was a little duplicating of the questions I linked, and I was mainly interested in the other part of my question because of that. | |
Jun 19, 2019 at 18:24 | history | answered | ShapeOfMatter | CC BY-SA 4.0 |