-
Notifications
You must be signed in to change notification settings - Fork 5
Decision Tables
ericmeyer edited this page Sep 1, 2012
·
6 revisions
They are described here: http://fitnesse.org/FitNesse.UserGuide.SliM.DecisionTable. This document is more how to implement them.
Decision tables are good for testing anything can be defined as a set of inputs and outputs, so they can be used for a wide variety of tests.
Mathematical functions obviously lend themselves well to this as does a lot of game logic.
On the MasterMind project, a decision table was used to drive the behavior of the taking a guess. https://github.com/ericmeyer/MasterMind
!|adding two numbers|
|a |b |result? |
|1 |2 |3 |
|11 |11 |22 |
|10 |5 |15 |
#import <Foundation/Foundation.h>
@interface AddingTwoNumbers : NSObject
@property (nonatomic, strong) NSString* a;
@property (nonatomic, strong) NSString* b;
@end#import "AddingTwoNumbers.h"
@implementation AddingTwoNumbers
-(int) result {
return [self.a intValue] + [self.b intValue];
}
@end