Jan. 7th, 2015

In my text exploration game project, I'm using HSpec to test my game. Why test? I first learned about test-driven development a couple months ago during Code Retreat in Pittsburgh. I'd never done any TDD before that. But over the course of the day, I found I really enjoyed process of writing small tests and making them pass. Most of the day, I was working with people who were very experienced with testing, but in other languages like Java, Scala, Clojure, or Python. The last session was the only time I worked with another Haskeller, and neither of us new how to test Haskell with anything but types and visually checking output. He was satisfied with that, but I really wanted to to fully learn TDD. That's why I added it to my project.

Adding tests to my code helped me reason through a lot of problems. I realized that a lot of the way that I had structured my program at first didn't make much sense and was really hard to test. For example, putting too much in one IO function. Now I think my code is more modular.

I still have a lot to learn about TDD in Haskell. I have a really hard time keeping to the red -> green -> refactor thing. I tend to either forget about the refactor part or go from refactoring to writing a bunch of new stuff without testing first.

Profile

horrorcheck

August 2015

S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526272829
3031     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 18th, 2025 10:45 pm
Powered by Dreamwidth Studios