loading words...

Apr 19, 2019 18:46:11

Test First Programming

by @brianball PATRON | 220 words | 392💌

Brian Ball

Total posts: 392💌
Total words: 108090 (432 pages 📄)

Imagine if schools started with a test.

It could be a short test -- those that didn't score 100% would be given a weeks worth of study material. Those that pass that test keep taking tests until we find what they don't know.


Then, they just work on the things they failed.


There's a movement in programming that's like that. It's called Test Driven Development - or TDD.


You have to know what you're trying to accomplish. Then, you write a test, that when passing, shows that your code is doing only what it's supposed to.


You start the coding with a failing test. Why is it failing? Because you haven't done any programming yet. You've only gotten the test written.


Then, you have to code a feature that causes the run of the tests to return green lights. Green means go. You can now write more tests.


Write a test and start with it failing. Then, write code. Then run tests. There's a rhythm.


It's slow. It's methodical. Some might even claim that it takes the fun out of programming. But, are you programming to have fun? Or, are you programming to help a business stay alive and ensure the livelihood of all the employees?


Code doesn't last forever. But it should last long enough to get the business up and running.

From Brian Ball's collection:

  • 1

    @brianball TDD is hard and slow! I definitely see the benefits, but I have never gotten into a good rhythm and struggle to actually do it. Sometimes it's just easier to push on and deal with it later but I wish TDD was more the norm than the exception. I think it truly takes a good teacher to impart the knowledge and the urgency of TDD in an engaging way... Have you done any decent online courses that you would recommend?

    Jack Lyons avatar Jack Lyons | Apr 19, 2019 20:11:16
    • 1

      @jacklyons - I'm enjoying the terseness of EggHead.io -- I recently got a membership. They go by very quickly -- feel like they're for the caffeinated , ADD personality. Which fits me well.

      Brian Ball avatar Brian Ball | Apr 20, 2019 21:08:57
contact: email - twitter / Terms / Privacy