US 12,436,872 B2
Code analysis device and code analysis method using MCDC method
Bhimsen Joshi, Telangana (IN); KwangChul Jeong, Seoul (KR); Satya Praveen Ganapathi, Telangana (IN); Ramesh Chitte, Telangana (IN); Lakshmi Manikanta Janjanam, Andra Pradesh (IN); Yong Suk Park, Suwon-si (KR); and Sripad Jangam, Telangana (IN)
Assigned to HYUNDAI MOTOR COMPANY, Seoul (KR); and Kia Corporation, Seoul (KR)
Filed by HYUNDAI MOTOR COMPANY, Seoul (KR); and Kia Corporation, Seoul (KR)
Filed on Sep. 27, 2023, as Appl. No. 18/373,446.
Claims priority of application No. 202211055248 (IN), filed on Sep. 27, 2022.
Prior Publication US 2024/0104007 A1, Mar. 28, 2024
Int. Cl. G06F 11/00 (2006.01); G06F 11/3668 (2025.01)
CPC G06F 11/3684 (2013.01) [G06F 11/3676 (2013.01)] 28 Claims
OG exemplary drawing
 
1. A code analysis method performed by a processor, the method comprising:
converting an expression indicated by a source code to a Boolean expression, the expression including n conditions;
generating a binary expression tree including a plurality of nodes based on the Boolean expression;
initializing a flip limit and a number of flips of each of the plurality of nodes by analyzing whether each of the plurality of nodes is a leaf node of which a name is an operand or a parent node of which a name is an operator;
generating a first test case by initialization Boolean values of each of a plurality of parent nodes each of which a name is an operator among the plurality of nodes and two child nodes of the plurality of parent nodes to one of a plurality of valid cases; and
generating n test cases by performing a flip on all node having flip feasibility on a path from a root node to a leaf node of the binary expression tree based on the first test case, and storing the first test and the n test cases,
wherein the flip is reversing the Boolean value of each corresponding node among the plurality of nodes, and the n is a natural number greater than or equal to 2.