-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample2.py
More file actions
26 lines (24 loc) · 787 Bytes
/
example2.py
File metadata and controls
26 lines (24 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import pandas as pd
import utils
import intrepyd
import intrepyd.tools as it
import intrepyd.atg.mcdc as mcdc
def doMain():
ctx = intrepyd.Context()
circ = it.translate_simulink('example2.slx', 'float')
decisions = {
'example2/O1' : ['A', 'B', 'C'],
'example2/O2' : ['A', 'B', 'C', 'D'],
'example2/O3' : ['C', 'D']
}
dec2tables, dec2indpairs, _ = mcdc.compute_mcdc(ctx, circ.SimulinkCircuit, decisions, 0)
dec2df = mcdc.get_tables_as_dataframe(dec2tables)
for decision, df in dec2df.iteritems():
print 'MC/DC table for', decision
print df
print
print 'Independence pairs for', decision
utils.pretty_print_ind_pair(dec2indpairs[decision])
print
if __name__ == "__main__":
doMain()