Professional Documents
Culture Documents
Unit Testing 0.1
Unit Testing 0.1
Unit testing
Are you building it right?
Why?
Dog food
Painful lessons
What is unit testing?
Unit
Test
Types of tests
What to test
Happy flows
Negative scenarios
When to write tests
Test quality ~ expected code lifespan
How
Setup
Exercise
Verify
Teardown
Test doubles
Dummy Object Sitting pretty
return
doTinka(intentName,button,mode,kbaid,dialogPath,"ghome");
}
System.out.println("XNDF not a postback found this
one:"+q+" ::with score:"+bestCnt);
if (q!=null){
String s=traps(q,intentName);
if (s!=null) return s;
}
}
How to write testable code
Let’s look at some piece of code
private Messaging buildChoiceQuickReply(IAmPlusAdapterResponseEvent
iAmPlusAdapterResponseEvent) {
@NonNls
String TALK_TO_TINKA_POSTBACK = ChatbotPostback.TALK_TO_TINKA.name();
@NonNls
String TALK_TO_AN_AGENT_POSTBACK = ChatbotPostback.TALK_TO_AN_AGENT.name();