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

上游充通大皇 SJTU School Of Software 2009-2-3 Chapter 3 Test environment and tools 软件学院
SJTU School Of Software 2009-2-3 软件学院 Chapter 3 Test environment and tools

上游充鱼大警 SJTU School Of Software 2009-2-3 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/ 软件学院
SJTU School Of Software 2009-2-3 软件学院 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/

上浒充通大 SJTU School Of Software 2009-2-3 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 软件学院
SJTU School Of Software 2009-2-3 软件学院 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

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

上游充鱼大 SJTU School Of Software 2009-2-3 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. 软件学院
SJTU School Of Software 2009-2-3 软件学院 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

上游充道大 SJTU School Of Software 2009-2-3 JUNIT安装 1.http://www.junit.org/index.htm 下载JUNIT包JUNIT.JAR 2.将JAR文件拷贝到JDK的LIB目录, C:\Javaljdk1.5.0llib.. ☆3.在CLASSPATH目录下增加一条 c:\Javaljdk 1.5.0llibljunit.jar; 软件学院
SJTU School Of Software 2009-2-3 软件学院 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;

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

上浒充通大学 SJTU School Of Software 2009-2-3 D Hello.iava 1 package example; 2 3vpublic class Hello 4 5 public static void main(String[]args)( 8 99 public int abs(int n){ 10 return n>=0 n (-n) 12 软件学院
SJTU School Of Software 2009-2-3 软件学院

上游充通大 SJTU School Of Software 2009-2-3 下一步,我们准备对这个方法进行测试,确保功能正 常。选中Hello.java,右键点击,选择New->JUnit Test Case: Packaoe Explorerx JUnit -☐CrystalBlog Hello 白src 白由 example DHello.java JRE Syst Ne型 Project... 由JUNIT_H 合classes Open F3 审Package dist Open With docs F4 Class Open Type Hierarchy 合b Interface report 自Copy Ctrl+C 影buld,xml Source Folder 色Paste Ctrl+V ▣Jexi Folder ▣petstore Delete Delete 子File SendMail Source Alt+Shift+S Refactor Alt+Shift+T 目JUnit Test Case Import... other... Ctrl+N 2☑Export.. 软件学院
SJTU School Of Software 2009-2-3 软件学院 下一步,我们准备对这个方法进行测试,确保功能正 常。选中Hello.java,右键点击,选择New->JUnit Test Case:

上浒充通大粤 SJTU School Of Software 2009-2-3 Eclipse会询问是否添加junit,.jar包,确定后新建一个HelloTest类, 用来测试Hello类。一般自己导入下载的junit包。 Newy JUnit Test Case JUnit Test Case Select the name of the new JUnit test case.You have the options to specify the class under test and on the next page,to select methods to be tested. Source Folder: Hello/src Browse,.· Package: example Browse.·· Name: HelloTest Superclass: junit.framework.TestCase Browse· Which method stubs would you like to create? public static void main(String[]args) Add TestRunner statement for: text ui setup() tearDown() ■constructor( Class Under Test: example.Hello Browse... 次件学院 Back Next> Finish Cancel
SJTU School Of Software 2009-2-3 软件学院 Eclipse会询问是否添加junit.jar包,确定后新建一个HelloTest类, 用来测试Hello类。一般自己导入下载的junit包
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 上海交通大学:《软件测试与质量控制》课程教学资源(课件讲稿)教学大纲(高级软件测试).doc
- 上海交通大学:《软件测试与质量控制》课程教学资源(课件讲稿)chapter 1 Introduction of software testing.pdf
- 上海交通大学:《软件测试与质量控制》课程教学资源(课件讲稿)Chapter 2 fundamentals of software test.pdf
- 上海交通大学:《软件测试与质量控制》课程教学资源(课件讲稿)第4章 Fundamental theory and methods of software test.pdf
- 上海交通大学:《软件测试与质量控制》课程教学资源(课件讲稿)第2章 Prerequisites Mathematics knowledge of software test.pdf
- 上海交通大学:《软件测试与质量控制》课程教学资源(课件讲稿)第3章 Test environment and tools.pdf
- 上海交通大学:《软件测试与质量控制》课程教学资源(课件讲稿)第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
- 上海交通大学:《软件测试与质量控制》课程教学资源(课件讲稿)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
- 上海交通大学:《面向对象分析与设计 Object Oriented Analysis and Design》课程教学资源(PPT课件讲稿)14 Subsystem Design.ppt
- 上海交通大学:《面向对象分析与设计 Object Oriented Analysis and Design》课程教学资源(PPT课件讲稿)16 Database Design.ppt
- 上海交通大学:《面向对象分析与设计 Object Oriented Analysis and Design》课程教学资源(PPT课件讲稿)17 Model Driven Development.ppt
- 上海交通大学:《面向对象分析与设计 Object Oriented Analysis and Design》课程教学资源(PPT课件讲稿)19 Aspect-Oriented Software Development(AOSD).ppt
- 上海交通大学:《微型计算机技术及在材料加工中的应用》教学资源_微型计算机概述.pdf
- 上海交通大学:《微型计算机技术及在材料加工中的应用》教学资源_第三章作业.pdf