软件测试ST03_Logic_Coverage_第1页
软件测试ST03_Logic_Coverage_第2页
软件测试ST03_Logic_Coverage_第3页
软件测试ST03_Logic_Coverage_第4页
软件测试ST03_Logic_Coverage_第5页
已阅读5页,还剩166页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、软件测试与质量保证申明:本课件是在原书作者课件基础上编制,仅用于课堂教学,不得用于任何商业目的的活动。1 LOGICAL COVERAGEChapter 3 逻辑覆盖第3章OUTLINEOverview: Logic Predicates and ClausesLogical Expression Coverage CriteriaStructural Logical Coverage of ProgramsSpecification-Based Logic CoverageLogical Coverage of Finite State MachinesDisjunctive Normal

2、Form Criteria(Master Level)4大纲概览:逻辑谓词和子句逻辑表达式覆盖标准程序结构化逻辑覆盖基于规约的逻辑覆盖有限状态机的逻辑覆盖析取范式标准(硕士水平)5CH. 3 : LOGIC COVERAGEApplied toApplied toApplied to6第三章: 逻辑覆盖应用于应用于应用于7COVERING LOGIC EXPRESSIONSLogic expressions show up in many situationsCovering logic expressions is required by the US Federal Aviation Ad

3、ministration for safety critical softwareLogical expressions can come from many sourcesDecisions in programsFSMs and statechartsRequirementsTests are intended to choose some subset of the total number of truth assignments to the expressions8覆盖逻辑表达式 逻辑表达式出现在许多情况下 美国联邦航空管理局的安全性至关重要的软件标准要求覆盖逻辑表达式 逻辑表达式

4、可以有多种来源决策程序FSMs和状态图需求 测试的目的是选择事实总数中的一些子集分配到表达式9LOGIC PREDICATES AND CLAUSESA predicate is an expression that evaluates to a boolean valuePredicates can containboolean variablesnon-boolean variables that contain , =, 、 =、 =、! =布尔函数调用内部结构是由逻辑运算符构建 取反操作符 和操作符 或操作符 蕴涵操作符 异或操作符 等价操作符子句是不含任何逻辑操作符的谓词11EXAM

5、PLES(a = n*o)Four clauses:(a = n*o) relational expressionMost predicates have few clausesIt would be nice to quantify that claim!Sources of predicatesDecisions in programsGuards in finite state machinesDecisions in UML activity graphsRequirements, both formal and informalSQL queries12示例(a = n*o)四个子句

6、:(a = n*o) 关系表达式大多数谓词有一些子句这将是很好进行量化该索赔!来源于谓词程序中的决策有限状态机中的监护条件在UML活动图中的决策分支需求,包括正式的和非正式的SQL查询13Humans have trouble translating from English to LogicTRANSLATING FROM ENGLISH“I am interested in SWE 637 and CS 652”course = swe637 OR course = cs652“If you leave before 6:30 AM, take Braddock to 495, if yo

7、u leave after 7:00 AM, take Prosperity to 50, then 50 to 495”time 7:00 path = ProsperityHmm this is incomplete !time = 6:30 path = Prosperity14从语言到逻辑人类的从语言到逻辑人类的翻译有问题翻译有问题从英语翻译“我对SWE 637 和 CS 652 有兴趣”course = swe637 OR course = cs652“如果你6:30离开之前,走向Braddock 495,如果你上午7点离开,达到Prosperity50,然后从50到495”time

8、 7:00 path = Prosperity嗯这是不完整的!time = 6:30 path = Prosperity15OUTLINEOverview: Logic Predicates and ClausesLogical Expression Coverage CriteriaStructural Logical Coverage of ProgramsSpecification-Based Logic CoverageLogical Coverage of Finite State MachinesDisjunctive Normal Form Criteria(Master Lev

9、el)16大纲概览:逻辑谓词和子句逻辑表达式覆盖标准程序结构化逻辑覆盖基于规约的逻辑覆盖有限状态机的逻辑覆盖析取范式标准(硕士水平)17TESTING AND COVERING PREDICATES(3.2)We use predicates in testing as follows :Developing a model of the software as one or more predicatesRequiring tests to satisfy some combination of clausesAbbreviations:P is the set of predicatesp

10、 is a single predicate in PC is the set of clauses in PCp is the set of clauses in predicate pc is a single clause in C18测试和覆盖谓词(3.2) 我们在测试中使用谓词如下:开发一个l软件模型作为一个或多个谓词需要测试满足一些组合的子句 缩写:P 是谓词集合p 是P中一个独立的词C 是P 中的子句集Cp 是谓词p中的子句c 是 C 中的独立子句19PREDICATE AND CLAUSE COVERAGEThe first (and simplest) two criteri

11、a require that each predicate and each clause be evaluated to both true and falseWhen predicates come from conditions on edges, this is equivalent to edge coveragePC does not evaluate all the clauses, so 20谓词和子句覆盖 首先(也是最简单的)两个标准需求是每个谓词和每个子句都被评估为true和false 当谓词来自边上的条件,这相当于边覆盖 谓词覆盖对不所有子句赋值,所以21PREDICAT

12、E COVERAGE EXAMPLE(a = n*o)predicate coveragePredicate = truea = 5, b = 10, D = true, m = 1, n = 1, o = 1= (5 = 1*1)= true true TRUE= truePredicate = falsea = 10, b = 5, D = false, m = 1, n = 1, o = 1= (10 = 1*1)= false false TRUE= false22谓词覆盖示例(a = n*o)谓词覆盖谓语谓语= truea = 5, b = 10, D = true, m = 1,

13、n = 1, o = 1= (5 = 1*1)= true true TRUE= true谓词谓词 = falsea = 10, b = 5, D = false, m = 1, n = 1, o = 1= (10 = 1*1)= false false TRUE= false23CLAUSE COVERAGE EXAMPLE(a = n*o)Clause coverageTwo tests(a b) = truea = 5, b = 10(a = n*o = truem = 1, n = 1, o = 1m = n*o = falsem = 1, n = 2, o = 2true cases

14、1) a = 5, b = 10, D = true, m = 1, n = 1, o = 1false cases2) a = 10, b = 5, D = false, m = 1, n = 2, o = 224子句覆盖示例(a = n*o)子句覆盖两个测试(a b) = truea = 5, b = 10(a = n*o = truem = 1, n = 1, o = 1m = n*o = falsem = 1, n = 2, o = 2真的情形1) a = 5, b = 10, D = true, m = 1, n = 1, o = 1假的情形2) a = 10, b = 5, D =

15、 false, m = 1, n = 2, o = 225PROBLEMS WITH PC AND CC PC does not fully exercise all the clauses, especially in the presence of short circuit evaluation CC does not always ensure PCThat is, we can satisfy CC without causing the predicate to be both true and falseThis is definitely not what we want !

16、The simplest solution is to test all combinations 26谓词覆盖PC和子句覆盖CC的问题 谓词覆盖没有充分执行所有的子句,尤其是在存在短路径赋值 子句覆盖不能总是确保谓词覆盖也就是说,我们可以满足子句覆盖不会导致谓词是true和false这绝对不是我们想要的东西! 最简单的解决方案是测试所有组合27COMBINATORIAL COVERAGECoC requires every possible combinationSometimes called Multiple Condition Coveragea = n*o(a = n*o)1TTTT

17、2TTFF3TFTT4TFFF5FTTT6FTFF7FFTF8FFFF28组合覆盖组合覆盖要求每一个可能的组合有时称为多条件覆盖a = n*o(a = n*o)1TTTT2TTFF3TFTT4TFFF5FTTT6FTFF7FFTF8FFFF29COMBINATORIAL COVERAGEThis is simple, neat, clean, and comprehensive But quite expensive!2N tests, where N is the number of clauses Impractical for predicates with more than 3 or

18、 4 clausesThe literature has lots of suggestions some confusingThe general idea is simple:Test each clause independently from the other clausesGetting the details right is hardWhat exactly does “independently” mean ?The book presents this idea as “making clauses active” 30组合覆盖 这是简单的,整洁、干净、全面的但是很昂贵!2

19、N 测试中 N 是子句的数量不现实的谓词超过3或4子句文献有很多建议有些令人困惑一般的想法很简单:独立于其他的子句测试每个子句获得细节信息的权力是很困难的“独立”到底是什么意思?这本书介绍了这个想法即“使子句有效”31ACTIVE CLAUSESClause coverage has a weakness : The values do not always make a differenceConsider the first test for clause coverage, which caused each clause to be true:(5 = 1*1)Only the fir

20、st clause counts !To really test the results of a clause, the clause should be the determining factor in the value of the predicateDetermination :A clause ci in predicate p, called the major clause, determines p if and only if the values of the remaining minor clauses cj are such that changing ci ch

21、anges the value of pThis is considered to make the clause active32有效子句 子句覆盖有一个缺点:值并不总是产生影响 考虑第一次对子句覆盖测试,它导致每个子句是ture:(5 = 1*1) 只有第一个子句计数! 要真正测试子句的结果,该子句应该谓词值中的决定因素决定 :一个子句ci在谓词p中,称为主要子句,它决定了p,当且仅当余下的较小子句cj是这样的,即改变ci将改变P的值。这是被认为有效子句33DETERMINING PREDICATESGoal : Find tests for each clause when the cl

22、ause determines the value of the predicateThis is formalized in several criteria that have subtle, but very important, differencesP = A Bif B = true, p is always true.so if B = false, A determines p.if A = false, B determines p.P = A Bif B = false, p is always false.so if B = true, A determines p.if

23、 A = true, B determines p.34决定谓词 目标:找到每个子句的测试,当子句决定谓词的值 这是若干标准的正式形式,有细微的差异,但是很重要P = A B如果B = true, p总是真。所以,如果B = false, A决定p。如果A= false, B决定p。P = A B如果B = false, p总是假。所以,如果B = true,A决定p。如果A= true,B决定p。35p = a b1)a = true, b = false2)a = false, b = false3)a = false, b = true4)a = false, b = falseACTI

24、VE CLAUSE COVERAGEThis is a form of MCDC, which is required by the FAA for safety critical softwareAmbiguity : Do the minor clauses have to have the same values when the major clause is true and false?Duplicatea is major clauseb is major clause36p = a b1)a = true, b = false2)a = false, b = false3)a

25、= false, b = true4)a = false, b = false有效子句覆盖这是一种MCDC(主句决定子句),这是由美国联邦航空局对安全关键软件的要求歧义:当主要子句是真和假,余下子句必须有相同的值?副本副本a 是主子句是主子句b 是主子句是主子句37RESOLVING THE AMBIGUITYThis question caused confusion among testers for yearsConsidering this carefully leads to three separate criteria :Minor clauses do not need to

26、be the sameMinor clauses do need to be the sameMinor clauses force the predicate to become both true and falsep = a (b c)Major clause : aa = true, b = false, c = truea = false, b = false, c = falsec = falseIs this allowed ?38解决歧义 这个问题在测试人员当中多年来引起混乱 仔细考虑导致三个独立的标准:次子句不需要做得相同次子句必须做的相同次子句使得谓词变为兼备true和fa

27、lsep = a (b c)主子句主子句: aa = true, b = false, c = truea = false, b = false, c = falsec = false这允许吗?39GENERAL ACTIVE CLAUSE COVERAGEThis is complicated !It is possible to satisfy GACC without satisfying predicate coverageWe really want to cause predicates to be both true and false !40广义有效的子句覆盖 这是复杂的! 它

28、可以满足GACC却没有满足谓词覆盖 我们真的想引起谓词是真和假!41RESTRICTED ACTIVE CLAUSE COVERAGEThis has been a common interpretation by aviation developersRACC often leads to infeasible test requirementsThere is no logical reason for such a restriction42限制性有效子句覆盖 这是一个航空开发常见的解释 RACC往往导致不可行的测试要求 有这样的限制是不合乎逻辑的理由43CORRELATED ACTIV

29、E CLAUSE COVERAGEA more recent interpretationImplicitly allows minor clauses to have different valuesExplicitly satisfies (subsumes) predicate coverage44相关有效子句覆盖 最近的一个解释 隐式地允许次子句有不同的值 显式地满足(涵括)谓词覆盖45CACC AND RACCabca (b c)1TTTT2TTFT3TFTT4TFFF5FTTF6FTFF7FFTF8FFFFTTTTFFFFamajor clausePa : b=true or c

30、= trueCACC can be satisfied by choosing any of rows 1, 2, 3 AND any of rows 5, 6, 7 a total of nine pairsabca (b c)1TTTT2TTFT3TFTT4TFFF5FTTF6FTFF7FFTF8FFFFTTTTFFFFaRACC can only be satisfied by row pairs (1, 5), (2, 6), or (3, 7)Only three pairs46相关有效子句覆盖和限制性有效子句覆盖abca (b c)1TTTT2TTFT3TFTT4TFFF5FTTF

31、6FTFF7FFTF8FFFFTTTTFFFFa主句主句Pa : b=true or c = trueCACC可以满足选择1、2、3任何的行和5、6、7任何行-总共九对abca (b c)1TTTT2TTFT3TFTT4TFFF5FTTF6FTFF7FFTF8FFFFTTTTFFFFaRACC只能满足行对(1、5),(2、6),或(3、7)只有三个对47INACTIVE CLAUSE COVERAGE The active clause coverage criteria ensure that “major” clauses do affect the predicates Inactive

32、 clause coverage takes the opposite approach major clauses do not affect the predicates48无效子句覆盖 有效子句覆盖标准确保“主”子句会影响谓词 无效子句覆盖却反其道而行之主子句不影响谓词49GENERAL AND RESTRICTED ICC Unlike ACC, the notion of correlation is not relevantci does not determine p, so cannot correlate with p Predicate coverage is always

33、 guaranteed50广义 和 限制性 无效子句覆盖 与ACC不同的是,相关的概念是不相关的 ci不决定p,所以不能决定p 可行性方面,谓词覆盖总是可得到满足51LOGIC COVERAGE CRITERIA SUBSUMPTION Clause CoverageCCPredicate CoveragePCCombinatorial Clause CoverageCOCRestricted Active Clause CoverageRACCRestricted Inactive Clause CoverageRICCGeneral Active Clause CoverageGACCCo

34、rrelated Active Clause CoverageCACCGeneral Inactive Clause CoverageGICC52逻辑覆盖标准包含关系子句覆盖CC谓词覆盖PC完全子句覆盖COC限制性有效子句覆盖RACC限制性无效子句覆盖RICC广义有效子句覆盖GACC相关有效子句覆盖CACC广义无效子句覆盖GICC53MAKING CLAUSES DETERMINE A PREDICATEFinding values for minor clauses cj is easy for simple predicatesBut how to find values for more

35、 complicated predicates ?Definitional approach: pc=true is predicate p with every occurrence of c replaced by true pc=false is predicate p with every occurrence of c replaced by falseTo find values for the minor clauses, connect pc=true and pc=falsewith exclusive ORpc = pc=true pc=falseAfter solving

36、, pcdescribes exactly the values needed for c to determine p54使子句决定谓词 寻找次子句 cj 的值,对简单谓词是容易的 但是如何找到更多的复杂谓词的值? 定义方法: pc=true 代表谓词 p 中 c 的每次出现都由 true 来代替 pc=false 代表谓词 p 中 c 的每次出现都由 false 来代替 寻找次子句的值, 用异或连接 pc=true 和 pc=falsepc = pc=true pc=false 结果是, pc 描述了 c 的取值决定p值的具体条件55EXAMPLESp = a bpa = pa=true

37、pa=false = (true b) XOR (false b) = true XOR b = bp = a bpa = pa=true pa=false = (true b) (false b) = b false = bp = a (b c)pa = pa=true pa=false = (true (b c) (false (b c) = true (b c) = (b c) = b c “NOT b NOT c” means either b or c can be false RACC requires the same choice for both values of a, C

38、ACC does not56示例p = a bpa = pa=true pa=false = (true b) (false b) = true b = bp = a bpa = pa=true pa=false = (true b) (false b) = b false = bp = a (b c)pa = pa=true pa=false = (true (b c) (false (b c) = true (b c) = (b c) = b c “NOT b NOT c”意味着b或c可以为假RACC需要对两个a值做相同选择,CACC却不是57REPEATED VARIABLES The

39、definitions in this chapter yield the same tests no matter how the predicate is expressed (a b) (c b) = (a c) b (a b) (b c) (a c)Only has 8 possible tests, not 64 Use the simplest form of the predicate, and ignore contradictory truth table assignments58重复变量 无论谓词怎样表示,本章中的定义都产生了相同的测试 (a b) (c b) = (a

40、c) b (a b) (b c) (a c)只有8个可能的测试,而不是64个 使用最简单的形式的谓词,并忽视矛盾复杂的赋值表59A MORE SUBTLE EXAMPLEp = ( a b ) ( a b)pa = pa=true pa=false = (true b) (true b) (false b) (false b) = (b b) false = true false = true a always determines the value of this predicate b never determines the value b is irrelevant !p = ( a

41、 b ) ( a b)pb = pb=true pb=false = (a true) (a true) (a false) (a false) = (a false) (false a) = a a = false60一个更微妙的例子p = ( a b ) ( a b)pa = pa=true pa=false = (true b) (true b) (false b) (false b) = (b b) false = true false = truea总是决定这个谓词的值b从来没有决定值- b是不相关的!p = ( a b ) ( a b)pb = pb=true pb=false =

42、 (a true) (a true) (a false) (a false) = (a false) (false a) = a a = false61INFEASIBLE TEST REQUIREMENTSConsider the predicate:(a b b c) c a(a b) = true, (b c) = true, (c a) = true is infeasibleAs with graph-based criteria, infeasible test requirements have to be recognized and ignoredRecognizing in

43、feasible test requirements is hard, and in general, undecidableSoftware testing is inexact engineering, not science62不可行的测试需求 考虑谓词:(a b b c) c a(a b) = true, (b c) = true, (c a) = true是不可行的 作为图形为基础的标准,不可行的测试需求必须得到承认和忽略 认识不可行的测试需求是很难的,在一般情况下,不可判定的 软件测试是不准确的工程,而不是科学63LOGIC COVERAGE SUMMARYPredicates a

44、re often very simplein practice, most have less than 3 clausesIn fact, most predicates only have one clause !With only clause, PC is enoughWith 2 or 3 clauses, CoC is practicalAdvantages of ACC and ICC criteria significant for large predicates CoC is impractical for predicates with many clausesContr

45、ol software often has many complicated predicates, with lots of clausesQuestion why dont complexity metrics count the number of clauses in predicates?64逻辑覆盖总结 在实践中谓词通常很简单的,大多数少于3个子句事实上,大多数谓词只有一个子句!只有子句,谓词覆盖(PC)就够了2或3子句,组合覆盖(CoC)是实用的对于大型谓词有效子句覆盖(ACC)和无效子句覆盖(ICC)标准的优势显著对很多子句,组合覆盖(CoC)是不切实际 控制软件通常有许多复杂

46、的谓词,有大量的子句 问题为什么不能对谓词中子句的数目进行度量复杂性计数?65OUTLINEOverview: Logic Predicates and ClausesLogical Expression Coverage CriteriaStructural Logical Coverage of ProgramsSpecification-Based Logic CoverageLogical Coverage of Finite State MachinesDisjunctive Normal Form Criteria(Master Level)66大纲概览:逻辑谓词和子句逻辑表达式覆

47、盖标准程序结构化逻辑覆盖基于规约的逻辑覆盖有限状态机的逻辑覆盖析取范式标准(硕士水平)67LOGIC EXPRESSIONS FROM SOURCEPredicates are derived from decision statements in programsIn programs, most predicates have less than four clausesWise programmers actively strive to keep predicates simpleWhen a predicate only has one clause, COC, ACC, ICC,

48、and CC all collapse to predicate coverage (PC)Applying logic criteria to program source is hard because of reachability and controllability:Reachability : Before applying the criteria on a predicate at a particular statement, we have to get to that statementControllability : We have to find input va

49、lues that indirectly assign values to the variables in the predicatesVariables in the predicates that are not inputs to the program are called internal variablesThese issues are illustrated through an example in the following slides 68源程序逻辑表达式谓词是程序判断语句的推断在程序中,大多数谓词少于四个子句聪明的程序员的积极努力保持谓词简单当一个谓词只有一个子句,

50、组合覆盖CoC、有效子句覆盖ACC、无效子句覆盖ICC和子句覆盖CC对谓词覆盖(PC)全部失效对程序源代码使用逻辑标准的是很难的,因为可达性和可控性:可达性:在一个特定语句的谓词上应用覆盖标准,我们必须得到该语句可控性:我们必须找到间接指定值到谓词变量的输入值在谓词中不是输入到程序的变量,被称为内部变量我们来通过例子来理解这些概念.69TRIANG (PG 1 OF 5) 1 / Jeff Offutt - Java version Feb 2003 2 / The old standby: classify triangles 3 / Figures 3.2 and 3.3 in the b

51、ook. 4 import java.io.*; 5 class trityp 6 7 private static String triTypes = , / Ignore 0. 8 scalene, isosceles, equilateral, not a valid triangle; 9 private static String instructions = This is the ancient TriTyp program.nEnter three integers that represent the lengths of the sides of a triangle.nT

52、he triangle will be categorized as either scalene, isosceles, equilateralnor invalid.n; 10 11 public static void main (String argv) 12 / Driver program for trityp 13 int A, B, C; 14 int T;70三角形(页 1 / 5) 1 / Jeff Offutt - Java version Feb 2003 2 / 旧的备用旧的备用: 三角形分类三角形分类 3 / 教材图教材图 3.2 和图和图3.3. 4 import

53、 java.io.*; 5 class trityp 6 7 private static String triTypes = “”, / 忽略忽略 0. 8 scalene, isosceles, equilateral, not a valid triangle; 9 private static String instructions = “这是古老的三角形程序这是古老的三角形程序.n 输入三个整数各表示三角形的一条边输入三个整数各表示三角形的一条边.n 三角形将三角形将 被分为不等边、等腰、被分为不等边、等腰、等边等边n 或或不是三角形不是三角形.n; 10 11 public sta

54、tic void main (String argv) 12 / Driver program for trityp 13 int A, B, C; 14 int T;71TRIANG (PG 2 OF 5) 16 System.out.println (instructions); 17 System.out.println (Enter side 1: ); 18 A = getN(); 19 System.out.println (Enter side 2: ); 20 B = getN(); 21 System.out.println (Enter side 3: ); 22 C =

55、getN(); 23 T = Triang (A, B, C); 24 25 System.out.println (Result is: + triTypes T); 26 27 28 / =72三角形(页 2 / 5) 16 System.out.println (instructions); 17 System.out.println (“输入边输入边1: ); 18 A = getN(); 19 System.out.println (输入边输入边2: ); 20 B = getN(); 21 System.out.println (输入边输入边3: ); 22 C = getN();

56、 23 T = Triang (A, B, C); 24 25 System.out.println (“结果是结果是: + triTypes T); 26 27 28 / =73TRIANG (PG 3 OF 5) 29 / The main triangle classification method 30 private static int Triang (int Side1, int Side2, int Side3) 31 32 int tri_out; 33 34 / tri_out is output from the routine: 35 / Triang = 1 if t

57、riangle is scalene 36 / Triang = 2 if triangle is isosceles 37 / Triang = 3 if triangle is equilateral 38 / Triang = 4 if not a triangle 39 40 / After a quick confirmation that its a legal 41 / triangle, detect any sides of equal length 42 if (Side1 = 0 | Side2 = 0 | Side3 = 0) 43 44 tri_out = 4; 45

58、 return (tri_out); 46 74三角形(页 3 / 5) 29 / 三角形分类的主方法三角形分类的主方法 30 private static int Triang (int Side1, int Side2, int Side3) 31 32 int tri_out; 33 34 / tri_out 的输出规则的输出规则: 35 / Triang = 1 如果三角形是不等边的如果三角形是不等边的 36 / Triang = 2 如果如果三角形三角形是等腰的是等腰的 37 / Triang = 3 如果如果三角形三角形是是等边的是是等边的 38 / Triang = 4 如果不是

59、三角形如果不是三角形 39 40 /快速确认,这是一个合法的三角形后快速确认,这是一个合法的三角形后, 41 /检测任何等长的检测任何等长的边边 42 if (Side1 = 0 | Side2 = 0 | Side3 = 0) 43 44 tri_out = 4; 45 return (tri_out); 46 75TRIANG (PG 4 OF 5) 48 tri_out = 0; 49 if (Side1 = Side2) 50 tri_out = tri_out + 1; 51 if (Side1 = Side3) 52 tri_out = tri_out + 2; 53 if (Si

60、de2 = Side3) 54 tri_out = tri_out + 3; 55 if (tri_out = 0) 56 / Confirm its a legal triangle before declaring 57 / it to be scalene 58 59 if (Side1+Side2 = Side3 | Side2+Side3 = Side1 | 60 Side1+Side3 = Side2) 61 tri_out = 4; 62 else 63 tri_out = 1; 64 return (tri_out); 65 76三角形(页 4 / 5) 48 tri_out = 0; 49 if (Side1 = Side2) 50 tri_out = tri_out + 1; 51 if (Side1 = Side3) 52 tri_out = tri_out + 2; 53 if (Side2 = Side3) 54 tri

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论