3
yehaaw
4y

Recent posts from @kiki and others made me think about tests. So what are your 2 cents regarding integration tests?

Comments
  • 4
    Test and test well, lest ye crash in production.
  • 2
  • 1
    If you need tests to make sure you didn't forget something, well, how can you be sure you didn't forget to test for that particular case as well?

    It's actually more common than you might think; someone writes tests, following everything @atheist said, but they forget to test for many edge cases. They write the code which implicitly handles most (all) edge cases, it gets 100% test coverage, QA gives it a pass, everyone's happy. Then later someone needs to refactor that code (perhaps for better performance), making sure the original tests still pass. QA doesn't pay too much attention since it's just refactoring and the tests haven't changed, but the edge case logic has been lost in the process...

    If you're adding a safety net, make sure it won't fail when you need it the most; otherwise it's better to not waste your time with a poor safety net and instead take better care you won't need it at all.
  • 0
    Well I am a fan of different types of tests. There are cases where I definitely want unit tests which test just a single function (e.g. tax calculation inside a cart). Most of the time I stay with integration or e2e tests because they not only test the actual functionality the software provide but also let me refractor decent parts of an application without rewriting a lot of tests.
  • 0
    I hadn't much contact with testing as in "not my beer".

    What I despise is when tests aren't properly isolated and do not follow a clean workflow....

    E.g. letting integration tests running on prod rampage, having different configuration | environment | ..., Workflow of integration test is seperate of workflow of releasing artifacts (you can have a released artifact despite testing gone wrong), not clearly separating shared resources (e.g. databases, memory, folders, ...) and so on.

    When people tell me explicitly that their test suite is great, but it took prod down... i really want to take a dildo, write 'I tested smart, I went full retard' on it and stick it to their forehead.

    I call this marvelous beast the testicorn.

    ... Yes.... I had many testicorns in my life which might be a reason I never touched test suites myself, too much PTSD. I'd rather play with hardware.
  • 0
    Just a quick reminder than putting an obscene amount of mayonnaise in all the food you eat doesn’t make you a bad person.

    It’s just like people will prefer to interact with you as little as they possibly can.
  • 0
    Almost always want to implement at least some level of integration testing.

    You can have a perfect suite of unit tests to prove all your code works in isolation, but until you run at least some level of integration testing you'll never guarantee those units work together as expected.
Add Comment