上海交通大学:《软件测试与质量控制》课程教学资源(课件讲稿)第3章 Test environment and tools

图 上游充通大学 SHANGHAI JIAO TONG UNIVERSITY Chapter 3 Test environment and tools 1B三
Chapter 3 Test environment and tools

上商充通大 SHANGHAI JIAO TONG UNIVERSITY 1.Java 2.Eclipse 3.JUNIT 4.EMMA 5.实例
1. Java 2. Eclipse 3. JUNIT 4. EMMA 5. 实例

上浒充通大学 SHANGHAI JIAO TONG UNIVERSITY 3.1 Java Why is Java Easy to get source code and documentation Completed test environment More free test tools J2SE Development kit 5.0 http://java.com/en/desktop/
3.1 Java Why is Java ? • Easy to get source code and documentation • Completed test environment • More free test tools • J2SE Development kit 5.0 • http://java.com/en/desktop/

上游充通大学 SHANGHAI JIAO TONG UNIVERSITY 3.2 Eclipse Eclipse is a kind of universal platform-an open extensible IDE for anything and nothing in particular. It provides a feature-rich development environment that allows the developer to efficiently create tools that integrate seamlessly into the Eclipse Platform. www.Eclipse.org Example of Eclipse
3.2 Eclipse Eclipse is a kind of universal platform – an open extensible IDE for anything and nothing in particular. It provides a feature-rich development environment that allows the developer to efficiently create tools that integrate seamlessly into the Eclipse Platform. www.Eclipse.org Example of Eclipse

上游充通大 SHANGHAI JIAO TONG UNIVERSITY 3.3 JUNIT JUnit是由Erich Gamma和Kent Beck编写的 一个回归测试框架(regression testing framework)。Juniti测试是程序员测试,即所 谓白盒测试,因为程序员知道被测试的软件如 何(How)完成功能和完成什么样(What) 的功能。Junit是一套框架,继承TestCase类, 就可以用Junit:进行自动测试了。 http://www.junit.orq/index.htm
3.3 JUNIT JUnit是由 Erich Gamma 和 Kent Beck 编写的 一个回归测试框架(regression testing framework)。Junit测试是程序员测试,即所 谓白盒测试,因为程序员知道被测试的软件如 何(How)完成功能和完成什么样(What ) 的功能。Junit是一套框架,继承TestCase类, 就可以用Junit进行自动测试了。 http://www.junit.org/index.htm

上游充通大 JUNIT SHANGHAI JIAO TONG UNIVERSITY For application developers,testing forms an integral part of the development life-cycle. As old code is modified for reasons ranging from adding new functionality to speed optimizations,the risk of dependent functionality getting broken Increases. Tests that are written once,and can be run repeatedly is the only solution to avoid manually QA testing. To write these tests,for applications written in java, JUnit provides a solid framework for writing unit tests.Many JUnit integrations also exist to integrate your JUnit tests into build and development tools
JUNIT For application developers, testing forms an integral part of the development life-cycle. As old code is modified for reasons ranging from adding new functionality to speed optimizations, the risk of dependent functionality getting broken increases. Tests that are written once, and can be run repeatedly is the only solution to avoid manually QA testing. To write these tests, for applications written in java, JUnit provides a solid framework for writing unit tests. Many JUnit integrations also exist to integrate your JUnit tests into build and development tools

上浒充通大学 JUNIT安装 SHANGHAI JIAO TONG UNIVERSITY 1.从htto:/ww.junit.org/index.htm下载JUNT包 JUNIT.JAR ④2.将JAR文件拷贝到JDK的LIB目录, C:\Javaljdk1.5.0\lib. g 3.在CLASSPATH目录下增加一条c:\Javaljdk 1.5.0\lib\junit.jar;
JUNIT安装 1. 从http://www.junit.org/index.htm下载JUNIT包 JUNIT.JAR 2.将JAR文件拷贝到JDK的LIB目录, C:\Java\jdk1.5.0\lib.。 3. 在CLASSPATH 目录下增加一条 c:\Java\jdk 1.5.0\lib\junit.jar;

上游充通大学 在Eclipse中使用JUNIT SHANGHAI JIAO TONG UNIVERSITY 测试对于保证软件开发质量有着非常重要的作用, 单元测试更是必不可少,JUit是一个非常强大的 单元测试包,可以对一个/多个类的单个/多个方 法测试,还可以将不同的TestCase:组合成 TestSuit,使测试任务自动化。Eclipse同样集成 了JUnit,i 可以非常方便地编写TestCase。 我们创建一个Java工程,添加一个 example.Hello类,首先我们给Hello类添加一个 abs0方法,作用是返回绝对值:
在Eclipse中使用JUNIT 测试对于保证软件开发质量有着非常重要的作用, 单元测试更是必不可少,JUnit是一个非常强大的 单元测试包,可以对一个/多个类的单个/多个方 法测试,还可以将不同的TestCase组合成 TestSuit,使测试任务自动化。Eclipse同样集成 了JUnit,可以非常方便地编写TestCase。 我们创建一个Java工程,添加一个 example.Hello类,首先我们给Hello类添加一个 abs()方法,作用是返回绝对值:

上游充通大¥ SHANGHAI JIAO TONG UNIVERSITY DHello.fava 日 1 package example; 2 3public class Hello 4 5 public static void main(String[]args)( 8 9v public int abs(int n)( 1 return n>=0 2 n (-n); 11 1

上游充通大¥ SHANGHAI JIAO TONG UNIVERSITY 下一步,我们准备对这个方法进行测试,确保功能正常。中 Hello.java,右键点击,选择New->JUnit Test Case: Packaoe Explorer x JUnit -☐CrystalBlog 白Hello 白src 白串 example 中-DHello.java JRE Syst Ne型 Project... JUNIT_H classes Open F3 带Package dist Open With docs Class Open Type Hierarchy F4 合b Interface 合report 自Copy Ctrl+C 黑build,.xml Source Folder 自Paste Ctrl+V ☐Jexi Folder ▣petstore Delete Delete File i-☐SendMail Source Alt+Shift+S Refactor Alt+Shift+T JUnit Test Case Import... other... Ctrl+N E☑Export
下一步,我们准备对这个方法进行测试,确保功能正常。中 Hello.java,右键点击,选择New->JUnit Test Case:
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 上海交通大学:《软件测试与质量控制》课程教学资源(课件讲稿)第1章 Introduction of software testing.pdf
- 《软件工程概论》课程教学资源(参考资料)软件工程知识体系指南(2004版).pdf
- 《软件工程概论》课程教学资源(参考资料)Guide to the Software Engineering Body of Knowledge(SWEBOK)Version 3.0.pdf
- 中华人民共和国国家标准(GB/T8567一2006 代替GB/T8567-1988)计算机软件文档编制规范 Specification for computer software documentation.pdf
- 上海交通大学:《理论力学》课程教学资源(PPT讲稿)平面矢量.ppt
- 上海交通大学:《计算机硬件技术》课程PPT教学课件(计算机概论,孙德文).ppt
- 上海交通大学:《程序设计基础》课程教学资源(PPT课件讲稿)第9章 数据封装——结构体.ppt
- 上海交通大学:《程序设计基础》课程教学资源(PPT课件讲稿)第8章 间接访问——指针.ppt
- 上海交通大学:《程序设计基础》课程教学资源(PPT课件讲稿)第7章 数组.ppt
- 上海交通大学:《程序设计基础》课程教学资源(PPT课件讲稿)第6章 过程封装——函数.ppt
- 上海交通大学:《程序设计基础》课程教学资源(PPT课件讲稿)第4-5章 控制结构.ppt
- 上海交通大学:《程序设计基础》课程教学资源(PPT课件讲稿)第1-2章 计算机简介、C++编程入门.ppt
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Sample Exam Questions_Midterm 2008 sample.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Sample Exam Questions_midterm 2 sample solution.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Recitation Notes_recitation 14.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Recitation Notes_Recitation 11.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Other Resources_intrduction to computer and programming with C++ and MATLAB.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Assignments_assignment13.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Assignments_assignment12.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Assignments_assignment11.pdf
- 上海交通大学:《软件测试与质量控制》课程教学资源(课件讲稿)第2章 Prerequisites Mathematics knowledge of software test.pdf
- 上海交通大学:《软件测试与质量控制》课程教学资源(课件讲稿)第4章 Fundamental theory and methods of software test.pdf
- 上海交通大学:《软件测试与质量控制》课程教学资源(课件讲稿)Chapter 2 fundamentals of software test.pdf
- 上海交通大学:《软件测试与质量控制》课程教学资源(课件讲稿)chapter 1 Introduction of software testing.pdf
- 上海交通大学:《软件测试与质量控制》课程教学资源(课件讲稿)教学大纲(高级软件测试).doc
- 上海交通大学:《软件测试与质量控制》课程教学资源(课件讲稿)chapter 3 Test environment and tools.pdf
- 上海交通大学:《软件测试与质量控制》课程教学资源(课件讲稿)Chapter 2 fundamentals of software test.pdf
- 上海交通大学:《软件测试与质量控制》课程教学资源(课件讲稿)chapter 4 test case generation 1.pdf
- 上海交通大学:《面向对象分析与设计 Object Oriented Analysis and Design》课程教学资源(PPT课件讲稿)01 Introduction to Object Technology.ppt
- 上海交通大学:《面向对象分析与设计 Object Oriented Analysis and Design》课程教学资源(PPT课件讲稿)02 Introduction to Visual Modeling.ppt
- 上海交通大学:《面向对象分析与设计 Object Oriented Analysis and Design》课程教学资源(PPT课件讲稿)04 Interaction Diagrams.ppt
- 上海交通大学:《面向对象分析与设计 Object Oriented Analysis and Design》课程教学资源(PPT课件讲稿)05 ClassDiagrams.ppt
- 上海交通大学:《面向对象分析与设计 Object Oriented Analysis and Design》课程教学资源(PPT课件讲稿)06 Other UML Diagrams.ppt
- 上海交通大学:《面向对象分析与设计 Object Oriented Analysis and Design》课程教学资源(PPT课件讲稿)07 Design Pattern.ppt
- 上海交通大学:《面向对象分析与设计 Object Oriented Analysis and Design》课程教学资源(PPT课件讲稿)08 Requirements Overview.ppt
- 上海交通大学:《面向对象分析与设计 Object Oriented Analysis and Design》课程教学资源(PPT课件讲稿)09 Analysis and Design Overview.ppt
- 上海交通大学:《面向对象分析与设计 Object Oriented Analysis and Design》课程教学资源(PPT课件讲稿)10 Architectural Analysis.ppt
- 上海交通大学:《面向对象分析与设计 Object Oriented Analysis and Design》课程教学资源(PPT课件讲稿)11 Use-Case Analysis.ppt
- 上海交通大学:《面向对象分析与设计 Object Oriented Analysis and Design》课程教学资源(PPT课件讲稿)12 Architecture Design.ppt
- 上海交通大学:《面向对象分析与设计 Object Oriented Analysis and Design》课程教学资源(PPT课件讲稿)13 Use-Case Design.ppt