Page 270 - 《软件学报》2024年第6期
P. 270

2846                                                       软件学报  2024  年第  35  卷第  6  期


                                                表 1    BPEL  程序主要活动描述

                  Category  Activity                              Description
                            Receive  The beginning of a business process, responsible for receiving the request messages sent by a client
                            Reply  The end of the business process, responsible for returning the results of the business operation to the client
                 Basic activity
                            Assign  Assign a parameter under the <from> variable to a parameter under the <to> variable
                            Invoke  Invoke a service corresponding to a partner link and collect the result returned by the service
                           Sequence  Execute each activity within a Sequence in a given order
                              If   Determine whether certain conditions are met to perform a particular operation
                  Structured  While
                                   Determine whether certain conditions are met to enter a loop in an activity
                   activity  (RepeatUntil)
                            Flow   Define the activities that need to be executed in parallel
                            Scope  Define the action scope of an internal activity and provides a common component for the activities within it

                  1.2   变异分析

                    变异分析    (也称变异测试) 是一种基于缺陷的软件测试技术               [12,13] , 广泛用于评估测试用例集的充分性以及测试

                 技术的有效性. 变异分析通过模拟编程人员在软件开发过程中可能出现的一些错误植入故障, 执行测试用例集, 判
                 断测试用例集揭示这些故障的能力. 测试用例集的故障检测能力可以通过变异得分                           [14] 来衡量, 即测试用例集能够
                 杀死的非等价变异体       (语义上与原程序不一致的变异体) 占所有的非等价变异体的比例.
                    变异分析基于两个重要的假设           [13] : 熟练程序员假设  (熟练程序员编写出的缺陷代码与正确代码之间只有细微
                 差别, 仅通过小幅度代码修改即可更正错误) 和耦合效应假设                   (若某个测试用例可以检测出简单故障, 那么该测试
                 用例也有潜力检测出更复杂的故障).
                    传统变异分析流程如下         [15] : (1) 根据程序语言特征设计一组变异算子; (2) 在原程序上应用变异算子生成大量
                 变异体; (3) 从变异体集合中识别出等价变异体            (语义上与原程序一致的变异体) 并筛除; (4) 测试剩余变异体, 若执
                 行结果与原程序结果不一致, 则称该变异体被杀死; 否则, 变异体存活.
                  1.3   BPEL  变异算子
                    变异算子定义了将原程序转变为变异体的转换规则, 是实施变异分析的关键. 表                          2  总结了常见的    BPEL  程序
                 算子  [16] , 包括标识符替换、表达式变异、活动变异、异常与事件变异这                 4  类.
                                                表 2    BPEL  程序变异算子描述

                       Category      Mutation operator                    Description
                   Identifier substitute
                                          ISV        Substitute a variable identifier with another one of the same type
                       mutation
                                         EAA         Substitute an arithmetic operator (+ , – , * , /) with another operator
                                         EEU         Remove the unary subtraction operator from an expression
                                         ERR         Substitute a relational operator (< , > , <= , >= , = , ! =) with another one
                                          ELL        Substitute a logical operator (and , or) with another one
                                         ECC         Substitute a path operator (/ , //) with another one
                                         ECN         Increase or decrease the value of a numeric constant, add or remove a number
                   Expression mutation
                                         EMD         Set the duration to 0, or reduce the duration by half
                                         EMF         Set the cut-off time to 0, or reduce the cut-off time by half
                                          EIN        Insert XPath format “not” into a logical expression
                                          EIU        Insert XPath format unary subtraction into an arithmetic expression
                                          EAP        Substitute an expression with its absolute value
                                         EAN         Substitute an expression with its negative absolute value
                                         CFA         Replace an activity with an exit activity
                    Override criterion   CDE         Apply decision coverage criterion to a program
                       mutation          CCO         Apply condition coverage criterion to a program
                                         CDC         Apply decision/condition coverage criterion to a program
   265   266   267   268   269   270   271   272   273   274   275