Requirement matrix concepts & implementation
description
Transcript of Requirement matrix concepts & implementation
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
© BfT
Requirement MatrixConcepts and Implementation
An End-to-end Paradigm in Building Quality Applications
Bronnie F [email protected]立方体科技
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
2
AgendaSession I
1 RM basic concepts
2 Key features
3 Precedence & cascade
Session II
4 Implements and Implementations
5 RM engine
6 Code generation
Session III
7 Automated testing
8 Well known location paradigm
9 Quality cost
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
3
Ill forms in recording Business Rules
MS Excel used as the tool, but in the wrong manner
Drawings and flowcharts are generous: wrong tool
In forms needing to educate readers: some might not be able to grasp
With hidden columns, collapsed outlines: often source of omission in implementation
Pseudo code is aplenty embodying a lot of implementation details such as permissible value lists, result codes: too technical and too complex not to miss something
Prescribes process to achieve business requirement: the actual business rules may not have been recorded
Leading to: Difficult to scale business skill/knowledge
pool Difficult to achieve shared understanding
and sign-off High project cost by way of timeline,
personnel, fixes, customer relations
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
4
AgendaSession I
1 RM basic concepts
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
5
Propositional CalculusAugustus De Morgan’s Theorem 1 & 2
(A B) ( A) ( B) (A B) ( A) ( B)
To illustrate, we can look at this Truth Table:
The instantiation of De Morgan’s Theorem is very common in programming, such that:
If not (A and B) thensometimes, perhaps to facilitate comprehension, is written as:If not A or not B then
is Negate, is Or, is And, is Equivalence
Truth Table is a simple chart showing the possible combinations of truth-values for a statement form or an argument form in the Propositional Calculus
What are the key charactieristicsof a Truth Table?
A B A B (A B) A B ( A) ( B) A B (A B) ( A) ( B)
T(rue) T T F F F F T F F
F(alse) T T F T F F F T T
T F T F F T F F T T
F F F T T T T F T T
Convey an otherwise unfamiliar subject clearly and unambiguously Completeness can be checked The row order is insignificant The column order is also insignificant
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
6
Rules Male T T F F Age < 6 T F T F
Implements Use Male toilet a a a Use Female toilet a a a
Requirement Matrix: A First Look
A trivial example:
In a certain prestigious club in Singapore, there is a rule on the use of toilets: male and female shall use their respective toilets as marked, except that children of age below 6 can use either.
The following illustrates how the Truth Table is adopted:
Recall the following points: Convey an otherwise unfamiliar subject clearly and unambiguously Completeness can be checked The row order among Rules and/or among Implements is insignificant The column order taking both Rules and Implements together is also insignificant
Note the double line separating the Rules and the Implements
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
7
Rules Male T T F F Age < 6 T F T F
Implements Use Male toilet a a a Use Female toilet a a a
Rules Female T T FMale T T FAge < 6 T F T F
Implements Use Male toilet a a a Use Female toilet a a aSignal Error a
Requirement Matrix: Key Points
Unambiguity
This is good for so long as there are only Male and Female. This dimension is termed Invariant, which is a critical dependency in Business Rules.For the above to be “fool-proof”, it needs to be expanded to safeguard against future changes not well communicated.Invariants are often Enumerations. It is always a good practice to communicate the source of error with an error code
NMF
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
8
Completeness
While Truth Table is Bi-state, Requirement Matrix is Tri-state, ie. “T”(rue), “F”(alse) and “” (Ignored), for which the cell is left un-enteredNumber of cases = 2(number of business rules), thus 2 rules are completely described in 4 casesHowever, Invariant is a special rule with enumerated Elements that, in this example:
Number of cases = (Number of Elements in Invariant + 1 ) * 2(number of business rules remaining)
= (2+1)*21 = 6Homonyms are collapsed to provide better clarity
Requirement Matrix: Dimension
Rules Female T T FMale T T FAge < 6 T F T F
Implements Use Male toilet a a a Use Female toilet a a aSignal Error aNMF
Why are there only 5 shown?
F F
F F
T F
aNMF2NMF1
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
9
Requirement Matrix: Systematic
Male toilet admission
Gender is Male T F FAge < 6 T F
Admit a aReject aFOA
Female toilet admission
Gender is Female T F FAge < 6 T F
Admit a aReject aMOA
There should have been 2 as follows:
FOA = Non male over age limitMOA = Non female over age limit
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
10
AgendaSession I
1 RM basic concepts
2 Key features
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
11
A fictitious fragment in approving a loan:
If one is employed with an income of more than SGD3,000, one has to provide Proof of Income in any of: a CPF (Central Provident Fund) Contribution Statement an ETA (whatever that is) a payslip
If one is employed with an income of SGD3,000 or less, one has to provide Proof of Income, which must be a CPF Contribution Statement
If one is self-employed, one has to provide Proof of Income, which must be an NTA (Notice of Tax Assessment)
1. Give a title describing the purpose/objective2. Use the key Invariant as “anchor” to start it
off3. Write down the business rules one at a time,
applying some reasoning to facilitate comprehension
4. Group equivalent business rules as one5. Write down all the required actions
6. Build the matrix focusing on the key Invariant enumerations one at a time
7. Compile a collection of all the errors for easy reference
Requirement Matrix: Construction
Income VerificationEmployment Status
Employed Y Y Y Y Y NSelf-employed Y Y N
Income > SGD3,000 Y Y Y N NProof of Income Document
CPF Contribution Statement Y N Y N
ETA or payslip Y NNTA Y N
Reject E1 E2 E3 E4
Rejection codes & text:E1 Employed with >
SGD3,000 but without Proof of Income
E2 Employed with SGD3,000 but without Proof of Income
E3 Self-employed but without Proof of Income
E4 Employment Status not acceptable
Such as: Income depends on Employment, so the latter
is dealt with first, then the income itself Having dealt with income, then the Proof of
Income becomes relevant
Income Verification
Reject
Employment Status
Employed
Self-employedIncome > SGD3,000
Proof of Income Document
CPF Contribution StatementETA or payslip
NTA
Y Y Y Y Y
Y Y Y N N Y N Y N
Y N
E1 E2
Y Y
Y N
E3
NN
E4
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
12
A fictitious fragment in approving a loan:
If one is employed with an income of more than SGD3,000, one has to provide Proof of Income in any of:
a CPF (Central Provident Fund) Contribution Statement a ETA (whatever that is) a payslip
If one is employed with an income of SGD3,000 or less, one has to provide Proof of Income, which must be a CPF Contribution Statement
If one is self-employed, one has to provide Proof of Income, which must be an NTA
Requirement Matrix: Completeness
Income Verification
Employment Status
Employed Y Y Y Y Y N
Self-employed Y Y N
Income > SGD3,000 Y Y Y N N
Proof of Income Document
CPF Contribution Statement Y N Y N
ETA or payslip Y N
NTA Y N
Income Verification What it should have beenEmployment Status
Employed Y Y Y Y Y Y Y Y N N N N N N N NSelf-employed Y Y Y Y Y Y Y Y N N N N N N N N
Income > 3,000 Y Y Y Y N N N N Y Y Y Y N N N N Y Y Y Y N N N NProof of Income Document
CPF Contribution Statement Y N Y N Y N Y N Y N Y NETA or payslip Y N Y N Y N Y N Y N Y NNTA Y N Y N Y N Y N Y N Y N
Mathematically, the number of cases to illustrate =((Number of Elements in Invariant 1 + 1 ) *(Number of Elements in Invariant 2 + 1 ) *
2(number of business rules remaining)
There are 2 Invariants, Employment Status (2 elements) and Proof of Income Document (3 elements), and 1 business rule remaining that ( (2+1) * (3+1) ) * 21 = 3 * 4 * 2 = 24
Why are there only 8 cases illustrated?
Collapsing all those not applicable cases and homonyms leaving only 8
Y Y Y Y Y N
Y Y N
Y Y Y N N
Y N Y N
Y N
Y N
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
13
Income Verification
Employment Status
Employed Y Y Y Y Y N
Self-employed Y Y N
Income > SGD3,000 Y Y Y N N
Proof of Income Document
CPF Contribution Statement Y N Y N
ETA or payslip Y N
NTA Y N
Reject E1 E2 E3 E4
Income Verification
Employment Status
Employed Y Y Y Y Y N
Self-employed Y Y N
Income > SGD3,000 Y Y N Y N
Proof of Income Document
CPF Contribution Statement Y Y N N
ETA or payslip Y N
NTA Y N
Reject E3 E4
Loan Type Eligible
Term a a
Overdraft a a a
Reject E1 E2 E3 E4
Collect requirements: its brevity makes it easy to construct
Confirm requirements: its clarity helps to quickly spot errors and omissions
Respond quickly to requirement changes: simply marking in “Y”, “N”, “a”, and error codes
Analyse requirements: sorting rows and columns to bring chosen details into focus providing the needed different perspectives to the understanding
Communicate requirements: free from language idiosyncrasies in essay-type instruments to quickly achieve shared understanding*
Skill transfer: thus growing Human Capital scalability Scope Function Verification: not only to ensure
coverage, but also to provide good basis for effort estimation
Capitalise on pertinent technology: when using MS Excel, hyperlinks can be inserted to provide easy cross-referencing to other material
Automate tasks: the sometimes daunting task of compiling a full list of error codes can be achieved promptly through some VBA and/or VSTO implementation/s
Contribute to the CMMI Traceability
* Critically important to achieving timely Sign-Off and successes in Testing phases
Requirement Matrix: As a tool to …
Loan Type Eligible
Term a a
Overdraft a a a
Reject E1 E2 E3 E4
Functional Requirement
Function Verification
Test Suite T1 T2 T3 T4 T5 T6 T7 T8
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
14
Income Verification
Employment Status
Employed Y Y Y Y Y N
Self-employed Y Y N
Income > SGD3,000 Y Y Y N N
Proof of Income Document
CPF Contribution Statement Y N Y N
ETA or payslip Y N
NTA Y N
Loan Type Eligible
Term a a
Overdraft a a a
Reject E1 E2 E3 E4
Requirement Matrix: Verification … on that requirement is indeed met
Depending on the type of application, test cases can be as simple as sets of data being run through a batch program
More commonly, each may represent a series of steps in a process flow, which is typical of interaction intensive applications
This matrix demonstrates the test coverage drawing clear correlation between Requirement and the Verification of it
Traceability is also achieved
Test Suite T1 T2 T3 T4 T5 T6 T7 T8
Functional Requirement
Function Verification
Test case 1 a a a a a a a
Test case 2 a a a a
Test case 3 a a a a a a
Test case 4 a a a a
Test case 5 a a a a a
Test case 6 a a a a
In a separate matrix bound through Test Suite references
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
15
AgendaSession I
1 RM basic concepts
2 Key features
3 Precedence & cascade
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
16
A fictitious fragment for disbursement:
When an amount is presented, it shall be applied to accounts in the following order of precedence: Credit Card Overdraft
Any amount left over shall be applied to the House Suspense account
Recall the row order among Implements is insignificant and all Implements for any Business Rules case must be fulfilled irrespectively
Recur is placed last for easy comprehension Precedence is achieved in the Rules, not in the Implements Note that it is not “Recur if amount after applying > 0” which is subject of implementation optimisation
Precedence and Cascade
DisbursementOutstanding balance in account > 0
Credit Card Y N NOverdraft Y N
Apply amount to account
Credit Card a
Overdraft a
House Suspense a
Recur a a
Credit Card DisbursementAmount < Interest Y N
Deduct amount from Interest a
Deduct total Interest a
Deduct (Amount – Interest) from Spending a
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
17
AgendaSession I
1 RM basic concepts
2 Key features
3 Precedence & cascade
Session II
4 Implements and Implementations
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
18
In Business domain:Invariants are Enumerations, such as Employed, Retired, Self-employed, Unemployed
In Design and Development domain:They are often “system parameters” with low/no volatilityTheir implementation can be:
in literal constants, in-memory locations or database tables for purposes such as join or referential integrity check
in forms like 1, 2, 3 and 4, or E, R, SE and UE
Income Verification
Employment Status
Employed Y Y Y Y Y N
Self-employed Y Y N
Income > SGD3,000 Y Y Y N N
Proof of Income Document
CPF Contribution Statement Y N Y N
ETA or payslip Y N
NTA Y N
Loan Type Eligible
Term a a
Overdraft a a a
Reject E1 E2 E3 E4
Rules
Implements
Implements vs Implementation
Rules and Implements (aka Actions) are in the Business domain, in which order on columns and rows are insignificant
Implementation is in the Design and Development domain, in which order on columns and rows can be, but not necessarily, significant
Implementation
If applicant.ES = 1
If applicant.ES = 5
If applicant.Gross > 3000.00
If applicant.POI = 1
If applicant.POI = 2 or applicant.POI = 3
If applicant.POI = 4
LoanEligible(7)
LoanEligible(9)
ThrowEx(…)
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
19
This is actually very deterministic that can be easily automated.
This appears to be quite complex.
However, the steps are very algorithmic thus can be automated.
These are high value-add activities.When done RIGHT,
the system can be built in very high precision.
Income Verification
Employment Status
Employed Y Y Y Y Y N
Self-employed Y Y N
Income > SGD3,000 Y Y Y N N
Proof of Income Document
CPF Contribution Statement Y N Y N
ETA or payslip Y N
NTA Y N
Loan Type Eligible
Term a a
Overdraft a a a
Reject E1 E2 E3 E4
Requirement Matrix: Process Recap
Implementation
If applicant.ES = 1
If applicant.ES = 5
If applicant.Gross > 3000.00
If applicant.POI = 1
If applicant.POI = 2 or applicant.POI = 3
If applicant.POI = 4
LoanEligible(7)
LoanEligible(9)
ThrowEx(…)ThrowEx(E1)
Reject
a
ThrowEx(E2) a
ThrowEx(E3) a
ThrowEx(E4) a
1 2 3 4 5 6 7 8
1 1 1 1 1 0
1 1 0
1 1 1 0 0
1 0 1 0
1 0
1 0
1 1
1 1 1
1
1
1
1
Implementation Serial
1
2
3
4
5
6
7
8
9
10
11
12
Case Number 1
Evaluation ManifestImplementation Serial 1 3 4
Evaluation Target 1 1 1
2
1 3 5
1 1 1
3
1 3 4 5
1 1 0 0
4
1 3 4
1 0 1
5
1 3 4
1 0 0
6
2 6
1 1
7
2 6
1 0
8
1 2
0 0
Case Number 1
Eexecution Manifest Implementation Serial 7
2
7 8
3
9
4
8
5
10
6
8
7
11
8
12
Evaluation Manifest
Implementation Serial Execution Manifest
Evaluation Target Implementation Serial
Case Number
1 1 1 3 1 4 1 72 1 1 3 1 5 1 7 83 1 1 3 1 4 0 5 0 94 1 1 3 0 4 1 85 1 1 3 0 4 0 106 2 1 6 1 87 2 1 6 0 118 1 0 2 0 12
Evaluation Control Execution Control
Evaluation Start Execution Start
Evaluation Count Execution Count
3 0 1 03 3 2 14 6 1 33 10 1 43 13 1 52 16 1 62 18 1 72 20 1 8
4 5 6 7 81 1 3 0 4 1 1 1 3 0 4 0 2 1 6 1 2 1 6 0 1 0 2 0
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
Case Number 1 2 3
Evaluation Manifest
1 1 3 1 4 1 1 1 3 1 5 1 1 1 3 1 4 0 5 01 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Rules Evaluation Result
1 (…)2 (…)3 (…)4 (…)5 (…)6 (…)
For i = 1 To UBound(Rules_Evaluation_Result) Rules_Evaluation_Result(i) = Implemenation(i)Next
For i = 1 To UBound(Evaluation_Control) Do For j = 1 To Evaluation_Control(i).Evaluation_Count If Rules_Evaluation_Result(Evaluation_Manifest(Evaluation_Control(i).Evaluation_Start * 2 + (j * 2 - 1))) <> _ Evaluation_Manifest(Evaluation_Control(i).Evaluation_Start * 2 + (j * 2)) Then Exit Do End if Next For j = 1 To Execution_Control(i).Execution_Count x = Implemenatation(Execution_Manifest(Execution_Control(i).Execution_Start + j)) Next Exit Function Loop Until 0 = 0NextSystemCatastrophe Function Implementation(Serial As Integer) As Integer
Select Case Serial Case 1 Implementation = IIf(applicant.ES = 1, 1, 0) Case 2 Implementation = IIf(applicant.ES = 5, 1, 0) Case 3 Implementation = IIf(applicant.Gross > 3000.00, 1, 0) Case 4 Implementation = IIf(applicant.POI = 1, 1, 0) Case 5 Implementation = IIf(applicant.POI = 2 Or applicant.POI = 3, 1, 0) Case 6 Implementation = IIf(applicant.POI = 4, 1, 0) Case 7 Implementation = LoanEligible(7)
Case 8 Implementation = LoanEligible(9) Case 9 Implementation = ThrowEx(E1) Case 10 Implementation = ThrowEx(E2) Case 11 Implementation = ThrowEx(E3) Case 12 Implementation = ThrowEx(E4) Case Else SystemCatastropheEnd Select
3 Generate Code
Should 1 & 2 be achieved using MSExcel, 3 & 4 can be automated usng VSTO (Visual Studio Tool for Office)
Matrix everything that can be matrix-ed
1 Matrix the Requirement
2 Add Implementation
3Transform into programming artefacts
4 Write code
Automate everything that can be matrix-ed
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
20
AgendaSession I
1 RM basic concepts
2 Key features
3 Precedence & cascade
Session II
4 Implements and Implementations
5 RM engine
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
21
Function RM_Engine(RM_Manifest As Holon_Descriptor)
k = Execute(RM_Manifest.Implementation(0))
For i = 1 To UBound(RM_Manifest.Significance) If (k And RM_Manifest.Significance(i)) = _ RM_Manifest.TargetMatch(i) Then k = RM_Manifest.ExecutionPlan(i) Do While k <> 0 j = j + 1 If k And (2 ^ (j - 1)) <> 0 Then k = k Xor (2 ^ (j - 1)) x = Execute(RM_Manifest.Implementation(j)) End If Loop Exit Function End IfNextSystemCatastrophe
Requirement Matrix: An Optimised Generic Engine 1/2
Value
13
21
29
13
13
34
34 3
Significance
20 1 1 1 1 1 0 0 1
21 0 0 0 0 0 1 1 1
22 1 1 1 1 1 0 0 0
23 1 0 1 1 1 0 0 0
24 0 1 1 0 0 0 0 0
25 0 0 0 0 0 1 1 0
13
21 5 9 1 3
4 2 0
Target Match
1 1 1 1 1 0 0 0
0 0 0 0 0 1 1 0
1 1 1 0 0 0 0 0
1 0 0 1 0 0 0 0
0 1 0 0 0 0 0 0
0 0 0 0 0 1 0 020 1 1 0 0 0 0 0
21 0 1 0 1 0 1 0 0
22 0 0 1 0 0 0 0 0
23 0 0 0 0 1 0 0 0
24 0 0 0 0 0 0 1 0
25 0 0 0 0 0 0 0 1
Value
1 3 4 2 8 2 16
32
Execution Plan
Upon code being generated the Requirement Matrix engine can sport a more complex design without concern on inadvertant implementation mistakesObject Income_Verification Type Holon_Descriptor
Significance Integer 13, 21, 29, 13, 13, 34, 34, 3 TargetMatch Integer 13, 21, 5, 9, 1, 34, 2, 0 ExecutionPlan Integer 1, 3, 4, 2, 8, 2, 16, 32 Implementation Function _
‘Income_Verification_Implementation’Implementation Income_Verification 1 2 3 4 5 6 7 8
1 If applicant.ES = 1 1 1 1 1 1 0
2 If applicant.ES = 5 1 1 0
3 If applicant.Gross > 3000.00 1 1 1 0 0
4 If applicant.POI = 1 1 0 1 0
5 If applicant.POI = 2 or applicant.POI = 3 1 0
6 If applicant.POI = 4 1 0
7 LoanEligible(7) 1 1
8 LoanEligible(9) 1 1 1
9 ThrowEx(E1) 1
10 ThrowEx(E2) 1
11 ThrowEx(E3) 1
12 ThrowEx(E4) 1
0
0
0
0
0
0
1
2
3
4
5
6
Core.RM_Engine(Income_Verification)
Function Income_Verification_Implementation(Serial As Integer) As Integer
Select Case Serial Case 0 Income_Verification_Implementation = _ IIf(applicant.ES = 1, 1, 0) * 2 ^ 0 OR _ IIf(applicant.ES = 5, 1, 0) * 2 ^ 1 OR _ IIf(applicant.Gross > 3000.00, 1, 0) * 2 ^ 2 OR _ IIf(applicant.POI = 1, 1, 0) * 2 ^ 3 OR _ IIf(applicant.POI = 2 Or applicant.POI = 3, 1, 0) * 2 ^ 4 OR _ IIf(applicant.POI = 4, 1, 0) * 2 ^ 5 Case 1 Income_Verification_Implementation = LoanEligible(7) Case 2 Income_Verification_Implementation = LoanEligible(9) Case 3 Income_Verification_Implementation = ThrowEx(E1) Case 4 Income_Verification_Implementation = ThrowEx(E2) Case 5 Income_Verification_Implementation = ThrowEx(E3) Case 6 Income_Verification_Implementation = ThrowEx(E4) Case Else SystemCatastropheEnd Select
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
22
A fictitious fragment for disbursement:
When an amount is presented, it shall be applied to accounts in the following order of precedence:
Credit Card Overdraft
Any amount left over shall be applied to the House Suspense account
Cascade: Requirement Matrices do not need to be more
complex than be able to contain an “integral” concept/idea/topic
The componentisation can be “naturally” achieved consistent with the Business the system is built for
“Common modules” will be easily identifiable
Disbursement
If (Credit_Card.Interest + Credit_Card.Spending) > 0
If Overdraft.Total > 0
Core.RM_Engine(Credit_Card_Disbursement)
Deduct_Overdraft()
AddTo_House_Suspense()
If Payment.Amount <> 0
Precedence and Cascade 1/2
DisbursementOutstanding balance in account > 0
Credit Card Y N NOverdraft Y N
Apply amount to account
Credit Card a
Overdraft a
House Suspense a
Recur a a
Credit Card DisbursementAmount < Interest Y N
Deduct amount from Interest a
Deduct total Interest a
Deduct (Amount – Interest) from Spending a
Object Disbursement Type Holon_Descriptor
Significance Integer 1, 3, 3 TargetMatch Integer 1, 2, 0 ExecutionPlan Integer 1, 2, 4 Implementation Function _ ‘Disbursement_Implementation’
Recur Integer 4
Implementation Serial
0
123
Object Credit_Card_DisbursementType Holon_Descriptor
Significance Integer 1, 1 TargetMatch Integer 1, 0 ExecutionPlan Integer 1, 6 Implementation Function _ ‘Credit_Card_Disbursement_Implementation’
Recur Integer 0
Recursion: Expand the HolonDescriptor with a Recur for
the governing Implementation Serial Instantiate in such a manner that 0 (no
Implementation) marks a non-recursive Requirement Matrix
Update engine
Implemenation Serial
0
0
1
2
3
4
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
23
Function RM_Engine(RM_Manifest As Holon_Descriptor)
Do Do k = Execute(RM_Manifest.Implementation(0))
For i = 1 To UBound(RM_Manifest.Significance) If (k And RM_Manifest.Significance(i)) = _ RM_Manifest.TargetMatch(i) Then k = RM_Manifest.ExecutionPlan(i) Do While k <> 0 j = j + 1 If k And (2 ^ (j - 1)) <> 0 Then k = k Xor (2 ^ (j - 1)) x = Execute(RM_Manifest.Implementation(j)) End If Loop If RM_Manifest.Recur <> 0 then Exit Do Exit Function End If Next SystemCatastrophe Loop Until 0 = 0Loop Until Execute(RM_Manifest.Implementation(RM_Manifest.Recur)) = 0
Precedence and Cascade 2/2
Renders a simple mechanism to produce neatly structured code
Object Disbursement Type Holon_Descriptor
Significance Integer 1, 3, 3 TargetMatch Integer 1, 2, 0 ExecutionPlan Integer 1, 2, 4 Implementation Function _ ‘Disbursement_Implementation’
Recur Integer 4
Object Credit_Card_DisbursementType Holon_Descriptor
Significance Integer 1, 1 TargetMatch Integer 1, 0 ExecutionPlan Integer 1, 6 Implementation Function _ ‘Credit_Card_Disbursement_Implementation’
Recur Integer 0
Function Disbursement_Implementation(Serial As Integer) As Integer
Select Case Serial Case 0 Disbursement_Implementation = _ IIf((Credit_Card.Interest + Credit_Card.Spending) > 0, 1, 0) * 2 ^ 0 OR _ IIf(Overdraft.Total > 0, 1, 0) * 2 ^ 1 Case 1 Disbursement_Implementation = _ Core.RM_Engine(Credit_Card_Disbursement) Case 2 Disbursement_Implementation = _ Deduct_Overdraft() Case 3 Disbursement_Implementation = _ AddTo_House_Suspense() Case 4 Disbursement_Implementation = _ IIf(Payment.Amount <> 0, 1, 0) Case Else SystemCatastropheEnd Select
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
24
Requirement Matrix: An Optimised Generic Engine
Object Disbursement Type Holon_Descriptor Significance Integer 1, 3, 3 TargetMatch Integer 1, 2, 0 ExecutionPlan Integer 1, 2, 4 Implementation Function ‘Disbursement_Implementation’ Recur Integer 4
ID Text ‘Disbursement’
Core.RM_Engine(Disbursement)
Enhanced^with diagnostic
informationFunction RM_Engine(RM_Manifest As Holon_Descriptor)
Do Do k = Execute(RM_Manifest.Implementation(0))
For i = 1 To UBound(RM_Manifest.Significance) If (k And RM_Manifest.Significance(i)) = _ RM_Manifest.TargetMatch(i) Then k = RM_Manifest.ExecutionPlan(i) Do While k <> 0 j = j + 1 If k And (2 ^ (j - 1)) <> 0 Then k = k Xor (2 ^ (j - 1)) x = Execute(RM_Manifest.Implementation(j)) End If Loop If RM_Manifest.Recur <> 0 then Exit Do Exit Function End If Next SystemCatastrophe Loop Until 0 = 0Loop Until Execute(RM_Manifest.Implementation(RM_Manifest.Recur)) = 0
Function Disbursement_Implementation(Serial As Integer) As Integer
Select Case Serial Case 0 Disbursement_Implementation = _ IIf((Credit_Card.Interest + Credit_Card.Spending) > 0, 1, 0) * 2 ^ 0 OR _ IIf(Overdraft.Total > 0, 1, 0) * 2 ^ 1 Case 1 Disbursement_Implementation = _ Core.RM_Engine(Credit_Card_Disbursement) Case 2 Disbursement_Implementation = _ Deduct_Overdraft() Case 3 Disbursement_Implementation = _ AddTo_House_Suspense() Case 4 Disbursement_Implementation = _ IIf(Payment.Amount <> 0, 1, 0) Case Else SystemCatastropheEnd Select
Core.SerialOutOfBound(Serial, _ “Disbursement (0-4)”)
Core.RulesNotMatched(k, _ RM_Manifest)
Core.RulesMatched(k, RM_Manifest)
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
25
AgendaSession I
1 RM basic concepts
2 Key features
3 Precedence & cascade
Session II
4 Implements and Implementations
5 RM engine
6 Code generation
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
26
Code GenerationScenario:
A multi-task manager that adjusts the number of workers according to instructions given externally, eg via an API
Tasks to be performed has 2 priorities: high and normal; high priority tasks should be executed in preference
High priority tasks include those not completed at the time the service had an unscheduled break Tasks are recorded in a database table
Clear work queue
Increase/decrease worker
Increase thread count? Y N N N N
Any worker free? Y Y Y Y
Decrease thread count? Y N N N
Scheduled taskAny high priority task in memory Q? Y N N
Cycledatabase due? Y N
Scheduled and assign worker
Increase workers a
Decrease worker a
Get data from Render Queue (DB) a
Assign task to worker a a
Recurs a a a a a
N
N
N
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
27
AgendaSession I
1 RM basic concepts
2 Key features
3 Precedence & cascade
Session II
4 Implements and Implementations
5 RM engine
6 Code generation
Session III
7 Automated testing
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
28
Use MS Excel spreadsheet as medium with data elements in columns and
test cases in rows
Automated Unit TestUse Pattern toproduce TestData Script
Generate Test Data instantiating all combinations*
Specify watch result
* Experience will show that only boundary cases needed for data with ranged values
File test result
Capture the test specification and result to give total traceability For general review and analysis, development sign-off, regression test benchmarking, etc
Incremental test effort on complex requirement is fairly linearvs geometric in the traditional manual test method
Gives generally 4:1 (or better) ratio on Development:Unit Test effort
Unit under test
Test Harness:1 Bring in Unit under test2 Create Data objects3 Drive test data by row
4 Collect and insert back watch result5 Time stamping for performance analysis
Specify Unit under test
Test Data TimeStamp
Watch Result
Data elements in columnsTest cases in rows
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
29
AgendaSession I
1 RM basic concepts
2 Key features
3 Precedence & cascade
Session II
4 Implements and Implementations
5 RM engine
6 Code generation
Session III
7 Automated testing
8 Well known location paradigm
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
30
Holon XHolon Y
Holon Z
Well Known Location Paradigm
Holon A
in Well Known Location
Holon P
Holon B Holon Q
Data ObjectData Objects
Unit under test
Test Harness:1 Bring in Unit under test2 Create Data objects3 Drive test data by row
4 Collect and insert back watch result5 Time stamping for performance analysis
1 6 2 3 4 5
Test Data TimeStamp
Watch Result
Data elements in columnsTest cases in rows
Encourages clear algorithm and data access separation
Increases reusability: holons relevant to both online and batch type applications
Advance Incident Diagnostic capability enabler
Productisation Best Practice Total cost benefits
Data access & staging
Incident Diagnostic Information Collection
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
31
AgendaSession I
1 RM basic concepts
2 Key features
3 Precedence & cascade
Session II
4 Implements and Implementations
5 RM engine
6 Code generation
Session III
7 Automated testing
8 Well known location paradigm
9 Quality cost
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
32
The BIG Quality Question:What is 0.9999500?
0.951227046271588 representing that When 500 holons each achieving 99.99% correctness, the quality of this collection is only 95.12%
The issue is primarily on test coverage, specifically, at the foundational Unit Test stage
How complex a Quality system can be constructed at effective cost? How can a complex Quality system be constructed at effective cost?
By deploying an efficient test process which takes less effort to attain better coverage
0 80% 100%Coverage
100%
Effort
20%
0 80% 100%Coverage
100%
Effort
20%
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
33
System Requirement
Functional Requirement
Component Requirement
Program Requirement
System Verification
Function Verification
Interaction Verification
Implementation Verification
10
100
1,000
10,000
100,000
RolloutTestDevelopmentDesignRequirement
Cost to remove “bug” (note the non linear scale)
Life Cycle Stage when “bug” found
Quality Cost Bugs are very expensive
objects The later in the Life Cycle
Stage when one is found
the costlier it will be The cost illustration does
not include cost of consequential damages
Get the requirement right,first time, on time, every time,
to curtail cost
© BfT
Re
qu
ire
me
nt
Ma
trix
Co
nc
ep
ts
& I
mp
lem
en
ta
tio
nB
uild
ing
Qu
ality
Ap
plicati
on
s
© BfT
Requirement MatrixConcepts & Implementation
Building Quality Applications
Questions?Thoughts to share?
Session I1 RM basic concepts2 Key features3 Precedence & cascade
Session II4 Implements and Implementations5 RM engine6 Code generation
Session III7 Automated testing8 Well known location paradigm9 Quality cost