摘要
软件测试在软件生命周期中占据重要的地位,是软件产品交付用户使用之前保证软件质量的重要手段。在软件测试V模型中,测试阶段通常分为单元测试、集成测试、系统测试和验收测试。所谓好的开头是成功的一半,单元测试作为整个测试过程的第一阶段,自然占据着十分重要的地位。由于单元测试的高覆盖率要求,往往需要反复的运行诸多测试用例,这将增加大量的人力物力成本。如能正确熟练的使用单元测试工具,将极大地提高单元测试工作的效率和质量。但是,在软件测试课程中,对于单元测试的学习具有较大的难度。本文针对高职高专院校开设软件测试技术课程的现状,分析了单元测试的学习过程,并且针对目前流行的Java开发环境,选用Junit单元测试工具作为实例,介绍了Junit工具的使用方法和测试脚本的编写规范,并讨论了单元测试用例的设计方法,来全面的完成单元测试知识的教学。
Software testing plays an important role during software life cycle,it is the primary approach to verify software quality before releasing to users. Software Testing V-model is built up by Unit Testing,Integration Testing,System Testing and Acceptance Testing.A flying start brings half of success,so Unit Testing is more essential since it is the first stage during the whole testing process.Sometimes it needs more cost to maintain repeatable executions.It will improve the unit testing efficiency so much if we could select Unit Testing tools correctly.However,it is difficult to learn Unit Testing technology well during common lessons.In this article,the author analyzes current Unit Testing status,introduces how to use Junit tool,shows how to write testing script,and discusses how to design test cases.The main purpose is to help students learn Unit Testing more easily.
出处
《微型电脑应用》
2008年第5期24-26,23,共4页
Microcomputer Applications