Friday, 30 November 2012

At Patna for the OLPC Demo - 27th - 29th Nov 2012

Demo of the OLPC Laptop

Leadership Training on the Use of ICT in Teacher Education in Bihar: Strategic Workshop

Demo of the OLPC laptop 

Wednesday, 14 November 2012

BDD with NBehave starter example

Here is a quick help for BDD with NBehave beginners.

Also refer to this presentation by me on BDD and UADD at the Agile NCR conference  - BDD and UADD with Slim

The .feature text  file that describes the scenario(s) and which gets executed by NBehave !

The ActionSteps that define the actions proposed in the .feature file above in the BDD format of Given, When, Then.

And the production class,

 public class Calculator
        private int result;
        private int one, two;
        public void Enter(int o,int t)
            one = o;
            two = t;
        public void Add()
            result = one + two;
        public int Value() {
           return result; 

Below is the nbehave results

Monday, 12 November 2012

Behavior Driven Development with Tumbler

Will elaborate on comments and questions to this post :)

More on this can be found at -

Also refer to this presentation by me on BDD and UADD at the Agile NCR conference  -

import static tumbler.Tumbler.*;

import org.junit.runner.Result;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
import tumbler.Scenario;
import tumbler.Story;
import org.hamcrest.BaseMatcher;
import org.hamcrest.core.IsEqual;
import org.hamcrest.core.IsNot;
import org.hamcrest.core.IsNull;
import org.hamcrest.core.IsSame;
import tumbler.JUnit44TumblerRunner;
import tumbler.TumblerRunner;

@Story("Generate genome sequence from values passed")
public class GenomeTest {
    public void shouldGenerateCorrectPatern() {
        Given("A Genome sequence");
        GenomePattern gp = new GenomePattern();
        Object someValue=null;

        When("Genome pattern is to be generated");
        Result result = gp.generatePattern();

        Then("expect ATGAC");
        assertNull(result); // Making test pass as per TDD