Angel \”Java\” Lopez on Blog

May 10, 2013

TDD Kata (4): Lawnmover

Previous Post

In the previous post, I commented about by experience at pre-round at Google Code Jam.

The exercise B was Lawnmover:

https://code.google.com/codejam/contest/2270488/dashboard#s=p1

Problem

Alice and Bob have a lawn in front of their house, shaped like an N metre by M metre rectangle. Each year, they try to cut the lawn in some interesting pattern. They used to do their cutting with shears, which was very time-consuming; but now they have a new automatic lawnmower with multiple settings, and they want to try it out.

The new lawnmower has a height setting – you can set it to any height h between 1 and 100 millimetres, and it will cut all the grass higher than h it encounters to height h. You run it by entering the lawn at any part of the edge of the lawn; then the lawnmower goes in a straight line, perpendicular to the edge of the lawn it entered, cutting grass in a swath 1m wide, until it exits the lawn on the other side. The lawnmower’s height can be set only when it is not on the lawn.

Alice and Bob have a number of various patterns of grass that they could have on their lawn. For each of those, they want to know whether it’s possible to cut the grass into this pattern with their new lawnmower. Each pattern is described by specifying the height of the grass on each 1m x 1m square of the lawn.

The grass is initially 100mm high on the whole lawn.

I solved it, see:

https://github.com/ajlopez/TddOnTheRocks/tree/master/Lawnmover

As usual, the commit history by test:

https://github.com/ajlopez/TddOnTheRocks/commits/master/Lawnmover

I could solve the first small set provided by Google. But I failed with the big set, because my algorithm was not efficient enough. The big set should be solved in 8 minutes, and if you cannot, there is no other chance. My initial algorithm (see comments) attacked the largest number in cells. My second algorithm switched to start with the minimal numbers (my first guess was that both algorithms had the same time, but I was wrong). I learnt: some problems in Google are hard to test by hand, we don’t have the use case (input and expected output), that is the main difficult.

More katas are comming.

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

May 8, 2013

TDD Kata (3): Tic-Tac-Toe-Tomek

Previous Post
Next Post

Two weeks ago, I participated of the pre round of Google Code Jam. Exercise A was TicTacToeTomek:

https://code.google.com/codejam/contest/2270488/dashboard

Problem

Tic-Tac-Toe-Tomek is a game played on a 4 x 4 square board. The board starts empty, except that a single ‘T’ symbol may appear in one of the 16 squares. There are two players: X and O. They take turns to make moves, with X starting. In each move a player puts her symbol in one of the empty squares. Player X’s symbol is ‘X’, and player O’s symbol is ‘O’.

After a player’s move, if there is a row, column or a diagonal containing 4 of that player’s symbols, or containing 3 of her symbols and the ‘T’ symbol, she wins and the game ends. Otherwise the game continues with the other player’s move. If all of the fields are filled with symbols and nobody won, the game ends in a draw. See the sample input for examples of various winning positions.

Given a 4 x 4 board description containing ‘X’, ‘O’, ‘T’ and ‘.’ characters (where ‘.’ represents an empty square), describing the current state of a game, determine the status of the Tic-Tac-Toe-Tomek game going on. The statuses to choose from are:

  • “X won” (the game is over, and X won)
  • “O won” (the game is over, and O won)
  • “Draw” (the game is over, and it ended in a draw)
  • “Game has not completed” (the game is not over yet)

If there are empty cells, and the game is not over, you should output “Game has not completed”, even if the outcome of the game is inevitable.

An input file can be downloaded with different board positions, and our program should generate an output file with the results: X won, O won, tie, or the game is not finished, yet.

I wrote my solution using TDD, you can see the result at:

https://github.com/ajlopez/TddOnTheRocks/tree/master/TicTacToeTomek

The commit history, with test granularity:

https://github.com/ajlopez/TddOnTheRocks/commits/master/TicTacToeTomek

It was a simple exercise, and well adapted to TDD. Google accepted my solution to a small input file, and to a big one too. I should write about the other exercises (B, C, D) that are a bit more complicated for TDD:

- Each problem should be solved quickly. With TDD, you could implement an algorithm but it could be not efficient.

- The algorithm to implement is not evident, and you should write the increasing difficult input cases.

- Sometimes, given an input state, it is hard to reach (even by hand) a right output solution. Many of my attempts were rejected by Google, without much info about what is the right solution, so you must review manually each result.

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

May 6, 2013

TDD Kata (2): Alien Language

Previous Post
Next Post

Some week ago, Google Code Jam was mentioned in Spanish list TDDev.  One of the  past problems of this contest was Alien Language.

After years of study, scientists at Google Labs have discovered an alien language transmitted from a faraway planet. The alien language is very unique in that every word consists of exactly L lowercase letters. Also, there are exactly D words in this language.

Once the dictionary of all the words in the alien language was built, the next breakthrough was to discover that the aliens have been transmitting messages to Earth for the past decade. Unfortunately, these signals are weakened due to the distance between our two planets and some of the words may be misinterpreted. In order to help them decipher these messages, the scientists have asked you to devise an algorithm that will determine the number of possible interpretations for a given pattern.

A pattern consists of exactly L tokens. Each token is either a single lowercase letter (the scientists are very sure that this is the letter) or a group of unique lowercase letters surrounded by parenthesis ( and ). For example: (ab)d(dc) means the first letter is either a or b, the second letter is definitely d and the last letter is either d or c. Therefore, the pattern (ab)d(dc) can stand for either one of these 4 possibilities: add, adc, bdd, bdc.

I liked the problem. See in the page that we should read an input file with the words and patterns to process. We can download input files from the problem page, and upload an output file with our solution, generated by our problem. Then, Google will return if the answer is correct or not. So, I wrote a solution using  TDD:

https://github.com/ajlopez/TddOnTheRocks/tree/master/AlienLanguage

You can read commit history, with test granularity, at:

https://github.com/ajlopez/TddOnTheRocks/commits/master/AlienLanguage

One of the latests things I did was to refactor the detection of words that match a pattern. I could improve it, maybe using a word tree instead of a list of words, as I did in SimpleBoggle.

At the end, I wrote a console program that accepts an input file and writes an output file, as Google contest requires. I downloaded a big input file from Google, processed it, and uploaded the solution. Google answered: OK:

TDD rules ;-)

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

April 26, 2013

TDD Kata (1): Rock Paper Scissors Lizard Spock

Two weeks ago, I read at Spanish list TDDev a new kata published at the blog Aprendiendo TDD:

Piedra Papel Tijera Lagarto Spock

based on a problem published in (Spanish post)

http://www.solveet.com/exercises/Kata-Piedra-Papel-Tijera-Lagarto-Spock/20

I took the description from Wikipedia article:

http://en.wikipedia.org/wiki/Rock-paper-scissors-lizard-Spock

The rules of Rock-paper-scissors-lizard-Spock are:

  • Scissors cut paper
  • Paper covers rock
  • Rock crushes lizard
  • Lizard poisons Spock
  • Spock smashes (or melts) scissors
  • Scissors decapitate lizard
  • Lizard eats paper
  • Paper disproves Spock
  • Spock vaporizes rock
  • Rock breaks scissors

And then, I started to code the solution using TDD, in C#. You can check re result at:

https://github.com/ajlopez/TddOnTheRocks/tree/master/SpockGame

The commit history reveals commit by test:

https://github.com/ajlopez/TddOnTheRocks/commits/master/SpockGame

See the first test/commit: it didn’t compile. Then, it started to compile, but with red result. Then, I added the minimal code to pass the test, and refactor, and so on.

I decided to have two tests, one per permutation: testing Scissors cut Paper, and other testing Paper is cut by Scissors. I could refactor the test to have an internal method testing in both ways

The initial design was based on:

- Having an instance of Game class (the alternative was to have static methots, directly in the class)

- Having an enumeration for game options (Play.Scissors, etc…)

- Having an enumeration for the play result (PlayResult.Tie, PlayResult.FirstPlayer…)

Instead of having play result, I could put a method that compare two options, deciding which one is “greater”. Today, I could refactor the implementation to use that approach.

See the last refactor: I could leave the code as is, with if command deciding which play wins, to decide when the first player wins:

But I wrote a  new way:

based on Wikipedia article suggestion:

One way to remember the rules is to remember the standard "rock-paper-scissors" ordering, where each gesture defeats the one before it, and is defeated by the one after. But then add the two novel gestures near the word they approximately rhyme with:

  1. Rock
  2. Spock
  3. Paper
  4. Lizard
  5. Scissors

In this expanded list, each gesture is defeated by the following two options, and defeats the preceding two.

But I feel the previous code is more clear. Sometimes, we must decide between having a clear code vs a clever one.

More TDD katas are coming.

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

March 10, 2013

TDD: Links, News And Resources (8)

Previous Post

Towards a Theory of Test-Driven Development | Java Code Geeks
http://www.javacodegeeks.com/2013/01/towards-a-theory-of-test-driven-development.html

jrcryer/phpunit-watchr · GitHub
https://github.com/jrcryer/phpunit-watchr
Simple node app to watch a directory and run phpunit tests

Investing in your tests–A lesson in object composition | Josh Arnold’s Blog
http://lostechies.com/josharnold/2012/12/22/investing-in-your-testsa-lesson-in-object-composition/

The No Mocks Book « Arlo Being Bloody Stupid
http://arlobelshee.com/post/the-no-mocks-book

James Shore: Blog: Lets-Play
http://www.jamesshore.com/Blog/Lets-Play/

Continuous Delivery with Maven and Go into Maven Central « Esko Luontola – Random Thoughts
http://blog.orfjackal.net/2012/08/continuous-delivery-with-maven-and-go.html

Let’s Code « ORFJackal.NjET
http://www.orfjackal.net/lets-code

On Being A Journeyman Software Developer: Roman Numerals Kata with Commentary
http://programmingtour.blogspot.com.ar/2012/12/roman-numerals-kata-with-commentary.html

jaycfields/expectations · GitHub
https://github.com/jaycfields/expectations

SUnit Explained
http://stephane.ducasse.free.fr/Programmez/OnTheWeb/SUnitEnglish2.pdf

SUnit
http://wiki.squeak.org/squeak/1547

Camp Smalltalk SUnit – Manual
http://sunit.sourceforge.net/manual.htm

What are the most widely used .NET practices and tools?
http://www.infoq.com/research/net-practices-tools?utm_source=infoqresearch&utm_campaign=rr-topicpages

Test your JavaScript skills with js-assessment | Hey, designer!
http://heydesigner.com/test-your-javascript-skills-with-js-assessment/

TDD for legacy code, graphics code, and legacy graphics code?
http://www.altdevblogaday.com/2012/04/08/tdd-for-legacy-code-graphics-code-and-legacy-graphics-code/

c++ – Is it possibile to use TDD with image processing algorithms? – Stack Overflow
http://stackoverflow.com/questions/1283147/is-it-possibile-to-use-tdd-with-image-processing-algorithms

Backwards Is Forward: Making Better Games with Test-Driven Development | Games from Within
http://gamesfromwithin.com/backwards-is-forward-making-better-games-with-test-driven-development

midje – ClojureSphere
http://www.clojuresphere.com/midje/midje

Seika/GameOfLife
https://github.com/Seika/GameOfLife

Classic TDD or "London School"? – Software People Inspiring
http://codemanship.co.uk/parlezuml/blog/?postid=987

My Links
http://delicious.com/ajlopez/tdd

March 7, 2013

Uncle Bob: Links and Resources (1)

Lot of interesting post about programming. And about one of my favorite topic: TDD, Test-Driven Development:

The Start-Up Trap | 8th Light
http://blog.8thlight.com/uncle-bob/2013/03/05/TheStartUpTrap.html

Clean Coders, Liskov
http://www.cleancoders.com/codecast/clean-code-episode-11-p1/show

Keynote: Architecture the Lost Years – Robert Martin – Ruby Midwest 2011
http://www.confreaks.com/videos/759-rubymidwest2011-keynote-architecture-the-lost-years

NO DB | 8th Light
http://blog.8thlight.com/uncle-bob/2012/05/15/NODB.html

Skills Matter : In The Brain of Uncle Bob (Robert C. Martin)
http://skillsmatter.com/podcast/agile-testing/uncle-bob-expert-insights/wd-23

ArticleS.UncleBob.ThePrimeFactorsKata
http://www.butunclebob.com/ArticleS.UncleBob.ThePrimeFactorsKata

Flipping the Bit | 8th Light
http://blog.8thlight.com/uncle-bob/2012/01/11/Flipping-the-Bit.html

The Barbarians are at the Gates | 8th Light
http://blog.8thlight.com/uncle-bob/2011/12/11/The-Barbarians-are-at-the-Gates.html

The delivery mechanism is an annoying detail – Coding the Architecture
http://www.codingthearchitecture.com/2011/11/06/the_delivery_mechanism_is_an_annoying_detail.html

Skills Matter : In The Brain of Uncle Bob (Robert C. Martin)
http://skillsmatter.com/podcast/agile-testing/bobs-last-language/js-2958

Simple Hickey | 8th Light
http://blog.8thlight.com/uncle-bob/2011/10/20/Simple-Hickey.html

Scrum Alliance – The Land that Scrum Forgot
http://scrumalliance.org/articles/300-the-land-that-scrum-forgot

Amazon.com: Agile Principles, Patterns, and Practices in C# (9780131857254): Robert C. Martin, Micah Martin: Books
http://www.amazon.com/Agile-Principles-Patterns-Practices-C/dp/0131857258

The Transformation Priority Premise – Uncle Bob’s Blog
http://cleancoder.posterous.com/the-transformation-priority-premise

What Killed Waterfall Could Kill Agile. – Uncle Bob’s Blog
http://cleancoder.posterous.com/what-killed-waterfall-could-kill-agile

OmelasBlog: Lo que mató a Waterfall podría matar a Agile
http://blog.omelas.net/2010/11/lo-que-mato-waterfall-podria-matar.html

Best In Class: Taking Uncle Bob to school
http://www.bestinclass.dk/index.clj/2010/10/taking-uncle-bob-to-school.html

Clojure with Uncle Bob
http://www.financialagile.com/reflections/8-software/21-clojure-with-uncle-bob

gist: 632303 – Prime factors Kata in Clojure- GitHub
http://gist.github.com/632303

Best In Class: Taking Uncle Bob to school
http://bestinclass.dk/index.clj/2010/10/taking-uncle-bob-to-school.html

Uncle Bob Martin’s "Clojure – Up Close and Personal" on Vimeo
http://vimeo.com/15046335

The Clean Coder: Why Clojure?
http://thecleancoder.blogspot.com/2010/08/why-clojure.html

YouTube – RailsConf 09: Robert Martin, "What Killed Smalltalk Could Kill Ruby, Too"
http://www.youtube.com/watch?v=YX3iRjKj7C0

ArticleS.UncleBob.TheThreeRulesOfTdd
http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd

InfoQ: Craftsmanship and Ethics
http://www.infoq.com/presentations/craftmanship-ethics

My Links
https://delicious.com/ajlopez/unclebob

October 20, 2012

TDD: Links, News And Resources (7)

Previous Post
Next Post

TDDD: Test-Driven Development Dojo en Sevilla 1/4
http://www.youtube.com/watch?v=2ednwZCyazU&feature=plcp

Introducción a IWT2 Dojo US. 5 noviembre 2.012
http://www.slideshare.net/Javier_J/introduccin-a-iwt2-dojo-us-5-noviembre-2012

IWT2 DojoUs. 05 octubre 2012. Ejercicio: Sokoban
http://www.slideshare.net/Javier_J/iwt2-dojous-05-octubre-2012-ejercicio-sokoban

IWT2 Dojo US. Introducción a TDD. 5 octubre 2012
http://www.slideshare.net/Javier_J/iwt2-dojo-us-introduccin-a-tdd-5-octubre-2012
Desarrollo de Videojuegos Dirigido por Pruebas

C#: How do I use Assert (Unit Testing) to verify that an exception has been thrown?
http://stackoverflow.com/questions/933613/c-how-do-i-use-assert-unit-testing-to-verify-that-an-exception-has-been-thro

Effective Mockito Part 3
http://eclipsesource.com/blogs/2011/10/13/effective-mockito-part-3/

fest
http://code.google.com/p/fest/
FEST is a collection of APIs, released under the Apache 2.0 license, whose mission is to simplify software testing. It is composed of various modules, which can be used with TestNG or JUnit.

Why You Don’t Get Mock Objects
http://confreaks.com/videos/659-rubyconf2011-why-you-don-t-get-mock-objects

What I’ve Learned About Testing Over the Last Year
http://jakegoulding.com/blog/2011/10/10/learned-about-testing-last-year/

Functional TDD: A Clash of Cultures
https://www.facebook.com/notes/kent-beck/functional-tdd-a-clash-of-cultures/472392329460303

The Day the QA Department Died
http://www.infoq.com/articles/day-qa-dept-died

What are the most widely used .NET practices and tools?
http://www.infoq.com/research/net-practices-tools

Refactoring: Replace Conditional with Polymorphism
http://robots.thoughtbot.com/post/31728620503/refactoring-replace-conditional-with-polymorphism

Introduction To JavaScript Unit Testing
http://coding.smashingmagazine.com/2012/06/27/introduction-to-javascript-unit-testing/

The Best Approach to Software Development
http://java.dzone.com/articles/best-approach-software

Classic TDD or “London School”?
http://codemanship.co.uk/parlezuml/blog/?postid=987

Testability and Entity Framework 4.0
http://msdn.microsoft.com/en-us/ff714955.aspx

lshimokawa / codingdojo
https://github.com/lshimokawa/codingdojo
Boilerplate code for starting Coding Dojos, each folder contains a unit testing framework configured with an initial test.

How test-driven development works (and more!)
http://www.jbrains.ca/permalink/how-test-driven-development-works-and-more

Walkthrough: Using TDD with ASP.NET MVC
http://msdn.microsoft.com/en-us/library/ff847525.aspx

The ROI of Test-Driven Development
http://powersoftwo.agileinstitute.com/2012/08/the-roi-of-test-driven-development.html

Testing ASP.NET MVC Views, from New Project to the Build Server
http://channel9.msdn.com/Events/aspConf/aspConf/Testing-ASP-NET-MVC-Views-from-New-Project-to-the-Build-Server

bigeasy / proof
https://github.com/bigeasy/proof
A test non-framework for Node.js

03×02 Mock, Stub, Spy y otras hierbas con Carlos Ble
http://www.32minutos.net/?p=14

Video: BDD, por Jorge Gamba, desde el Campus Party Colombia
http://www.codeandbeyond.org/2012/07/video-bdd-por-jorge-gamba-desde-el.html

My Links
http://delicious.com/ajlopez/tdd

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

October 5, 2012

TDD: Links, News And Resources (6)

Previous Post
Next Post

Expresso
http://visionmedia.github.com/expresso/
Expresso is a JavaScript TDD framework written for nodejs. Expresso is extremely fast, and is packed with features such as additional assertion methods, code coverage reporting, CI support, and more.
Automating UI Tests In WPF Applications
http://msdn.microsoft.com/en-us/magazine/dd483216.aspx

hjwp / Test-Driven-Django-Tutorial
https://github.com/hjwp/Test-Driven-Django-Tutorial
source code & text for a tutorial on using doing TDD django

Effective Mockito Part 1
http://eclipsesource.com/blogs/2011/09/19/effective-mockito-part-1/
Emulating “self types” using Java Generics to simplify fluent API implementation
http://passion.forco.de/content/emulating-self-types-using-java-generics-simplify-fluent-api-implementation
When TDD Fails
http://bitroar.posterous.com/when-tdd-fails
…The more generic it is (dependency-inject the calendar!), the better…. <– I disagree. TDD doesn’t push for it
…Typical MVC controller methods (actions) are a good example of this issue…. <– I disaree.
…but it really isn’t if you use all that added code just for tests and don’t do anything with it in your actual application. … <– I disagree. It’s not the case if you pursue use case implementation!
…Anything that is not testable is bad design. …. <– I disagree. TDD doesn’t go for testability, but for grow software.
….

Growing Object-Oriented Software, Guided by Tests
http://www.amazon.com/gp/product/0321503627

The Desktop Fishbowl
Charles blogs all the random nerd stuff he can find.

Six Rules of Unit Testing
http://radio-weblogs.com/0100190/stories/2002/07/25/sixRulesOfUnitTesting.html
google-js-test
http://code.google.com/p/google-js-test/
Lightweight JS unit testing using the V8 engine

Why You Don’t Get Mock Objects
http://confreaks.com/videos/659-rubyconf2011-why-you-don-t-get-mock-objects
Although the Ruby community has embraced TDD like no other community ever has, we have always looked at mock objects with disdain, and perhaps even a little hatred….

When TDD Fails
http://news.ycombinator.com/item?id=3061439
See the comments. Discuss.

Sinon.JS
http://sinonjs.org/
Standalone test spies, stubs and mocks for JavaScript. No dependencies, works with any unit testing framework.

THE ART OF MISDIRECTION
http://dannorth.net/the-art-of-misdirection/

Best books about TDD
http://stackoverflow.com/questions/31837/best-books-about-tdd
The Primer Factors Kata
http://www.butunclebob.com/ArticleS.UncleBob.ThePrimeFactorsKata

seattlerb / minitest
https://github.com/seattlerb/minitest
minitest provides a complete suite of testing facilities supporting TDD, BDD, mocking, and benchmarking.

orfjackal / tdd-tetris-tutorial
https://github.com/orfjackal/tdd-tetris-tutorial
Tutorial for learning TDD. You make a Tetris game by writing code to pass the test cases.

Learning Test Driven Development (TDD) through katas
http://sedano.org/journal/2012/6/1/learning-test-driven-development-tdd-through-katas.html
Downloadable Katas
http://nimblepros.com/what-we-do/event-resources.aspx

TDD Exercise Ideas
http://stackoverflow.com/questions/2443697/tdd-exercise-ideas
Welcome to TDD Problems!
https://sites.google.com/site/tddproblems/
The aim of this site is to contain a growing collection of software problems well-suited for the TDD-beginner and apprentice to learn Test-Driven Development through problem solving.
Test Driven Single Page Web Applications
http://joseoncode.com/2011/11/14/test-driven-single-page-web-applications/
by @jfroma
Solveet
http://www.solveet.com/
Desafios de Programacion

Seven Steps to Great Unit Test Names
http://agileinaflash.blogspot.de/2012/05/seven-steps-to-great-unit-test-names.html
Addy Osmani on JavaScript, Debugging and Testing
http://www.infoq.com/interviews/addy-osmani-javascript
Addy Osman shares his experience from working on popular open source JavaScript libraries and frameworks. He also gives many tips about testing, debugging and maintaining big JavaScript projects.

My Links
http://delicious.com/ajlopez/tdd

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

September 28, 2012

TDD: Links, News And Resources (5)

Previous Post

You know: production code without TDD is condemned by Geneva Convention ;-) . More resources about one of my favorites topics:

mfncooper / sidedoor
https://github.com/mfncooper/sidedoor
Exposing a secondary API for your Node.js modules

Kata – the Only Way to Learn TDD
http://www.peterprovost.org/blog/2012/05/02/kata-the-only-way-to-learn-tdd/
Test Driven Development in PHP
http://stackoverflow.com/questions/46276/test-driven-development-in-php

Unit testing in node.js
http://caolanmcmahon.com/posts/unit_testing_in_node_js

Unit testing node.js apps
http://cjohansen.no/en/node_js/unit_testing_node_js_apps

Test Driven Development in Python
http://powertwenty.com/kpd/downloads/TestDrivenDevelopmentInPython.pdf

Ruby, Setting $stdout per-thread
http://blog.segment7.net/2006/08/16/setting-stdout-per-thread

TATFT — I feel a revolution coming on
http://smartic.us/2008/08/15/tatft-i-feel-a-revolution-coming-on/

Just enough testing
http://smartic.us/2012/04/12/just-enough-testing/

Testing like the TSA
http://37signals.com/svn/posts/3159-testing-like-the-tsa

ELisp Testing
http://nic.ferrier.me.uk/blog/2011_09/elisp_testing

Jasmine
http://pivotal.github.com/jasmine/
Jasmine is a behavior-driven development framework for testing your JavaScript code.

Why I hate Test Driven Development
http://www.altdevblogaday.com/2012/03/30/why-i-hate-tdd/

How to not solve a Sudoku
http://devgrind.com/2007/04/25/how-to-not-solve-a-sudoku/

Sudoku 4: Disaster Narrowly Averted
http://xprogramming.com/xpmag/Sudoku4
Sudoku: Learning, Thinking and Doing Something About It
http://xprogramming.com/xpmag/SudokuMusings

Moving On With Sudoku
http://xprogramming.com/xpmag/Sudoku2

OK, Sudoku
http://xprogramming.com/xpmag/OkSudoku

ASP.NET Web Forms 4.5, MVVM and Testability
http://blogs.microsoft.co.il/blogs/oric/archive/2012/02/22/asp-net-web-forms-and-mvvm.aspx
MS Test, el framework de test de Visual Studio 2010
http://www.genbetadev.com/herramientas/ms-test-el-framework-de-test-de-visual-studio-2010

Erlang EUnit – introduction
http://erlcode.wordpress.com/2010/08/30/erlang-eunit-introduction/

My Links
http://delicious.com/ajlopez/tdd

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

August 30, 2012

TDD: Links, News And Resources (4)

Previous Post
Next Post

TDD is part of my daily tools. More links about how to do TDD with different technologies:

[node.js] Getting started with nodeunit « I Prefer Jim
http://www.ipreferjim.com/2011/08/node-js-getting-started-with-nodeunit/
The following code is part of the testing chapter I previously worked on in my fork of Mastering Node.Throughout this post, you’ll see references to files from a relative directory. If you clone my fork of Mastering Node, these file locations are relative to the root directory of that cloned …

Tdd on the rocks
http://www.slideshare.net/hernanwilkinson/tdd-on-the-rocks
Presentacion usada durante el coding dojo de TDD on the Rock en Agiles@BsAsPresentacion usada durante el coding dojo de TDD on the Rock en Agiles@BsAs

Newsletter Marzo 2012 | http://www.10pines.com
http://www.10pines.com/content/newsletter-marzo-2012
¡Gracias nuevamente por leer nuestra newsletter! Como en las ediciones anteriores, les recordamos que no dejen de anotarse en los cursos destacados que tenemos este año, como el de Jurgen Appelo sobre Management 3.0 y el de Hernán Wilkinson sobre Al mismo tiempo les comentamos que este mes hemos …

Testing Private State and Mocking Dependencies – How To Node – NodeJS
http://howtonode.org/testing-private-state-and-mocking-deps
During Christmas I’ve been working on SlimJim and found some tricks how to make my testing life easier. It’s nothing special at all, just a simple way how to access private state of a module and how to mock out some dependencies. I’ve found these two techniques pretty usefull, so I believe it might …

How to mock the Request on Controller in ASP.Net MVC?
http://stackoverflow.com/questions/970198/how-to-mock-the-request-on-controller-in-asp-net-mvc

Fabio Pereira » Testing Pyramid – A Case Study
http://fabiopereira.me/blog/2012/03/05/testing-pyramid-a-case-study/
Test automation is prevalent in the software development community. Practices like TDD and BDD are widespread and applied almost unquestionably. However, several organisations have struggled in attempting to scale automated test suites, which very often become slow, brittle, non-deterministic, …

Be Genius
http://bjeanes.com/2012/02/factories-breed-complexity
I am an Australian software craftsman living and working in Chicago. I strongly advocate open-source software and the community around it. I currently work primarily in Ruby and Rails but have recently been doing more and more Javascript and Clojure. I use Vim.Having maintainable code is great. …

Getting started with Jasmine tests in FubuMVC applications
http://ivonna.biz/blog/2012/2/19/getting-started-with-jasmine-tests-in-fubumvc-applications.aspx
These tags look unfamiliar. Their meaning is explained in the bindings file: this.Asset() is a method that adds a script/css to the list of assets of the page. Note that it produces no output; in order to write all scripts (together with their dependencies), you have to call or, using our bindings, …

Screencast: Coding Conway’s Game of Life in Ruby the TDD Way with RSpec
http://www.rubyinside.com/screencast-coding-conways-game-of-life-in-ruby-the-tdd-way-with-rspec-5564.html
Recently, there have been many screencasts of people coding things in real time. Yesterday, Ryan Bigg released a video of him implementing Conway’s Game of Life from scratch by reading through the ‘rules’ and then using RSpec to take a test driven approach to fleshing out the functionality.Ryan is …

InfoQ: Unit Testing on Mobile Devices with .NET/Mono
http://www.infoq.com/news/2012/02/Unit-Testing-Mobile
An ongoing problem with specialized platforms is the lack of support for unit testing. Developers are forced to compromise the quality of their tests or their build process in order to get anything working. Recently MonoTouch has made progress in this area, but Windows Phone and Mono for Android …

C#: Builder pattern still useful for test data at Mark Needham
http://www.markhneedham.com/blog/2009/01/21/c-builder-pattern-still-useful-for-test-data/
I had thought that with the ability to use the new object initalizer syntax in C# 3.0 meant that the builder pattern was now no longer necessary but some recent refactoring efforts have made me believe otherwise.My original thought was that the builder pattern was really useful for providing a …

How to apply what you’ve learned from TDD to writing data migrations
http://robots.thoughtbot.com/post/17549345094/how-to-apply-what-youve-learned-from-tdd-to-writing
After doing TDD full time for years, I have a hard time writing code without a test. One example that I find particularly difficult is writing data migrations.Some schema changes require more than just setting a default value for all existing rows. For example, let’s say you have this schema:If you …

¡Hola TDD! Kata-Lonja
http://holatdd.com/videos/kata-lonja
Creeme, se me da mejor hablar Ingles, que Español. Informate en El Kata InglesPorque programar solo esta pasado de moda. Si usas Eclipse, bajatelo en happyprog.com

David Chelimsky » Blog Archive » an introduction to RSpec – Part I
http://blog.davidchelimsky.net/2007/05/14/an-introduction-to-rspec-part-i/
Here’s an introductory tutorial for those of you interested in getting started with RSpec.Behaviour Driven Development is an Agile development process that comprises aspects of Acceptance Test Driven Planning, Domain Driven Design and Test Driven Development. RSpec is a BDD tool aimed at TDD in the …

Getting Started with RSpec – Looking for tutorials
http://stackoverflow.com/questions/201385/getting-started-with-rspec-looking-for-tutorials

Alexander Beletsky’s Development Blog: New Tools in My TDD Arsenal
http://www.beletsky.net/2012/02/new-tools-in-my-tdd-arsenal.html
Recently my TDD arsenal has been enhanced with 3 new cool tools, which I’m about to share with you. More precisely it one tool and two frameworks. Let’s go for it.NCrunch is just amazing extension for Visual Studio created by @remcomulder. It automatically detects all your tests and re-running …

Your tests are lying to you
http://chrismdp.github.com/2011/10/your-tests-are-lying-to-you/
Using mocks within your test suite has gone rather out of fashion. Programmers everywhere have been lamenting the fact that mock-based tests are becoming more and more brittle: they’re having to change the test code in multiple places each time there’s the slightest code change. In fact, they seem …

Abstracting away issues of HttpContext from your ASP.NET MVC controllers – Jeff …
http://weblogs.asp.net/jeff/archive/2012/02/03/abstracting-away-issues-of-httpcontext-from-your-asp-net-mvc-controllers.aspx
I’ve noticed that I write software in one of three modes:I have to admit that second case isn’t the most clean of endeavors. While I’m generally happy with the forum app and the feedback I get for it, it needs some refactoring in places. The thing that bothers me the most is that a lot of the …

The Pragmatic Bookshelf | PragPub 2011-04 | Test Abstraction
http://pragprog.com/magazines/2011-04/test-abstraction
In this article we illustrate several useful techniques you can use to improve your tests by increasing their level of abstraction.When doing TDD, the tests you create are the entry point into your system. Tests are where the coding starts. They are also how you drive changes into the system, …

The Pragmatic Bookshelf | PragPub 2012-01 | Unit Tests Are FIRST
http://pragprog.com/magazines/2012-01/unit-tests-are-first
A unit test is a small automated test, coded by a programmer, that verifies whether or not a small piece of production code—a unit—works as expected in isolation. The moniker unit test was popularized with the advent of tools such as SUnit (for Smalltalk) and JUnit. The XP crowd used the term to …

The Pragmatic Bookshelf | PragPub 2011-11 | Test-Driven Development
http://pragprog.com/magazines/2011-11/testdriven-development
Test-driven development (TDD) is a programmer practice that’s been employed by a growing number of software development teams for the past dozen years. Does TDD impact you personally? If you’re a manager, what should you expect from teams using TDD? How do you know if they’re doing a good job? Is …

Sustainable Test-Driven Development: Lies, Damned Lies, and Code Coverage
http://www.sustainabletdd.com/2011/12/lies-damned-lies-and-code-coverage.html
Amir Kolsky and Scott Bain are authors, trainers, and consultants who specialize in Test-Driven Development, Design Patterns, and Emergent Design.Amir and Scott are both senior consultants at Net Objectivesand are currently co-authoring the book “Sustainable Test-Driven Development”

Sustainable Test-Driven Development
http://www.sustainabletdd.com/
Amir Kolsky and Scott Bain are authors, trainers, and consultants who specialize in Test-Driven Development, Design Patterns, and Emergent Design.Amir and Scott are both senior consultants at Net Objectivesand are currently co-authoring the book “Sustainable Test-Driven Development”

Writing an API Wrapper in Ruby with TDD | Nettuts+
http://net.tutsplus.com/tutorials/ruby/writing-an-api-wrapper-in-ruby-with-tdd/
Sooner or later, all developers are required to interact with an API. The most difficult part is always related to reliably testing the code we write, and, as we want to make sure that everything works properly, we continuosly run code that queries the API itself. This process is slow and …

Excuse #5 – The Frequent Refactoring Excuse | The Code Sheriff
http://codesheriff.blogspot.com.ar/2011/11/excuse-5-frequent-refactoring-excuse.html

.NET to Ruby: Learning How to Write Tests, Part I » RubySource
http://rubysource.com/net-to-ruby-learning-how-to-write-tests/
If you’re a .NET developer who have been writing tests, this post may encourage you to continue doing so when working with Ruby. If, instead, you have not been writing tests, we must change that! I know I have mentioned this before, but I can’t stress enough how important it is.On my first years as …

NET to Ruby: Learning How to Write Tests, Part II » RubySource
http://rubysource.com/net-to-ruby-learning-how-to-write-tests-part-ii/
Part 1 of this post covered my experiences in .NET when writing tests, and how that helped me getting productive in Ruby within a short period of time. Part 2 covers my experiences in Ruby, going from how I got started writing tests as soon as I started doing anything with Ruby, until my current …

My Links
http://delicious.com/ajlopez/tdd

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

Older Posts »

Theme: Shocking Blue Green. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 28 other followers