Skip to main content

Test-Driven Development

I've been programming since my second year at university and I truly enjoy it. A couple of concepts have shaped my style, including that of test-driven development.

With TDD, before you implement any code you write at least one test for it. If you need to check more possibilities in terms of input you add tests. The most important thing is a new definition of software working: it works when it passes its tests.

TDD goes hand-in-hand with being an empiricist. The most interesting concepts are the ones that can be tested and/or verified, and that is when a concept graduates to become a fact.

Software can still have bugs with TDD; tests often miss things. Still, as a core concept it has made me a good deal more productive both in coding and in being an informed citizen.

When I consume media I am constantly barraged with claims that get through my filters. Claims that include no means of verification, no details, names, times and dates, etc. are essentially propaganda, designed to alter my opinions rather than to inform me and allow me to form my own opinions. 

The volume of such propaganda has become overwhelming on social media, and to my loss I closed my Facebook and Twitter accounts a while back. I do better when seeking information on my own than when a fire-hose is inserted in my mind.


Comments

Popular posts from this blog

Betrayal

I caught a student cheating on a final exam this morning. I had a line of sight on them and watched for ten minutes as they took their cellphone out of their pocket, kept it below their table, typed into it, read it, put it away, then wrote on the exam, repeating this cycle over and over again.  I was a bit surprised as the exam was open notes but this student had not attended many of our classes, just stopping by for exams, and I conjecture that they had no notes to open. I confronted the student who admitted that they had done wrong in an inarticulate non-confessional way. By the afternoon they had signed off on the honor code violation report to avoid further investigation and possible sanctions beyond failing the exam.  Is anger the right emotion to feel now? I had a working relationship with the student, although they had not contributed much to it. They had deceived me in order to gain unwarranted advantage over their peers in the class and that is not right. I don't wan...

Standing Your Corner

I'm a long-term David Simon fan ever since I read his book "Homicide", detailing a year-long embedding with Baltimore homicide detectives. It was clear-eyed about all of the strengths and weaknesses, good reflexes and prejudices of everyone that he met.  I enjoyed the television show that followed that he wrote for, and then of course "The Wire" on HBO and a number of his other shows---only limited by my access to streaming services.  There was a histrionic moment in a later season of "Homicide" where he just let a character vent; a homicide detective who was part-owner of a bar frequented by cops watched a particularly violent drug criminal, responsible for many unsolved homicides, come into his bar with his associates, violating the detective's territory. The detective came around the bar holding a billy club in his hand and loudly discussed his first year as a patrol officer walking a beat. His supervising officer told him that he had a corner a...

Car Accident

I was in a car accident a few days ago. There was a stopped car in the interstate and I didn't see it in advance; the car in front of me swerved into another lane and then there it was in front of me. I also swerved but damaged my commuter car, which is old and had many miles on it. The insurance company declared it a total loss.  The damage was where I scraped along the passenger side of my car (and the driver side of the stopped car). I had no deployment of airbags and no damage from my seat belt; no glass on either car broke, so it was a glancing blow if that makes sense. The front passenger wheel was damaged and I could not drive the car very far.  I pulled over to the shoulder and dialed 911. A state trooper made sure I was alright and proceeded to take care of the situation. I was moving slowly, aware that I had had a shock to my system and trying not to do anything to worsen the situation (stepping into traffic when I exited my vehicle, etc.) The trooper took my informa...