Hacker News new | past | comments | ask | show | jobs | submit login

Thanks for making this as accessible as you are! I would love to see more practical pieces on TDD, especially for the web.

How will you be sharing the source code? I would love to see TDD happen with a test committed followed by a commit to pass the test, etc. to get a sense of the full process or write my own passing code for each test and compare against another implementation.




I have started doing this for my training courses. When I demonstrate live, I commit to git. I use some variation of "FAILING" in the commit messages to call attention to "red" commits, in "violation" of the usual rule that tests pass 100% in all commits.

azundo, I know my examples aren't web apps, but do you have time/energy to explore any of the branches in this code base[1], read the commits, and give me feedback on how easily you follow it?

[1] https://github.com/jbrains/WorldsBestIntroToTdd-Tallinn-Janu...


Will also take a look and let you know! I'm not a serious java dev but can usually parse a bit of code here and there so will try and get you some useful feedback.


You're welcome! I haven't decided how I'm going to share source code. For my current series, I'm committing after every episode and posting on GitHub [1], so I'll do at least that much. Your idea of committing after every step of the TDD cycle is a really interesting one, but I'm not sure if could do that without it detracting from the videos. I've added it to my list of neat ideas.

[1] https://github.com/jamesshore/lets_play_tdd/commits/master


Hmm... thinking about this further, it shouldn't be too hard to have a wrapper for my build script that stores the most recent pass/fail state, then automatically commits when that state changes. The trick would be not polluting the continuous integration or end-of-episode branches. I'm sure it can be done, but my git-fu is weak and it would take some research. Might be a good stretch goal reward if funding goes well...


Maybe this: in "draft mode", you automatically commit on all changes in pass/fail state. Then, at some point, you "publish", at which point you squash all the commits from commit X to HEAD whose message matches "[ON RED]".

I imagine git rebase -i X | sed -i "magic happens here" would do the job.


Thanks for the reply! Good luck with reaching the funding goal - interested to hear how things go and if you do work out a way to get the build script working as well.


Okay, I did it. :-) I'm not sure how useful/readable the result is, but check it out and let me know what you think.

https://github.com/jamesshore/Autocommit


Awesome! Thanks for making this happen. Have downloaded the git repository and will take a look soon.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: