6

I read: "Don't change your implementation to do tests"

Then I read: "If it's too hard to test, your implementation is too complex"

Then we can get into test terminology itself, which is its own mess:

http://xunitpatterns.com/Mocks,%20F...

sheesh, if you thought the whole javascript / framework / web ecosystem always feels immature and behind other areas of software, i'm about to argue that testing patterns are even further behind

Comments
  • 3
  • 1
    > "'I'm about to argue that testing patterns are even further behind"

    Wanna start a fight?

    Tell a TDD'er that not all code needs to be testable.

    Then, to send em' into a murderous rage, tell them that integration tests are more important than unit tests.
  • 0
    @PaperTrail I'll fight! I would assume if a TDD'er wants "all code to be testable", that means they should hit 100% code coverage with their tests.

    Show me a project with 100% code coverage :)
  • 1
    @atheist - Thanks for these, I'm already really enjoying the talk!
  • 1
    "If I'm looking at my code and I cannot unit test it... then I have a question about my architecture: should this be unit-testable, and have I added some artificial complexity or coupling that we shouldn't have?"

    Brilliant.
  • 2
    @fullstackchris > "Show me a project with 100% code coverage"

    We had a team that pushed 100% code coverage and they had tests for *everything*, even models/DTOs/POCOs to achieve that 100%.

    myObject.Value = 3;

    Assert(MyObject.Value == 3);

    I refused to get any of my code to some arbitrary percent and 'called to the office' a time or two. That is another story (not enough space here)
  • 4
    Quantity vs Quality vs Maintenance Cost.

    Quantity - 100 % usually means tests are added without any necessity, as you _cannot_ test everything and 100 % is based on LoC which is nonsense... For various reasons.

    Quality - testing relevant stuff in an appropriate way. :) E.g. starting a database server process to test SELECT 1+1; is very inappropriate.

    Maintenance costs - keep it neat and clean. If the tests consume cost more resources than a devs salary something is fishy.

    If someone thinks I'm joking, nope. Jolly dead serious.

    I understand what @Kiki meant in his discussion and I really think that testing shouldn't check the obvious, rather the obnoxious.
  • 0
    @IntrusionCM > "I really think that testing shouldn't check the obvious, rather the obnoxious."

    YES!!!
Add Comment