General Principles<o:p></o:p>
l Test anything that might break<o:p></o:p>
l Test everything that does break<o:p></o:p>
l New code is guilty until proven innocent<o:p></o:p>
l Write at least as much test code as production code<o:p></o:p>
l Run local tests with each compile<o:p></o:p>
l Run all tests before check-in to repository<o:p></o:p>
Questions to Ask<o:p></o:p>
l If the code ran correctly, how would I know?<o:p></o:p>
l How am I going to test this?<o:p></o:p>
l What else can go wrong?<o:p></o:p>
l Could this same kind of problem happen anywhere else?<o:p></o:p>
<o:p> </o:p>
What to Test: Use Your RIGHT-BICEP<o:p></o:p>
l Are the results right?<o:p></o:p>
l Are all the Boundary conditions CORRECT?<o:p></o:p>
l Can you check Inverse relationships?<o:p></o:p>
l Can you Cross-check results using other means?<o:p></o:p>
l Can you force Error conditions to happen?<o:p></o:p>
l Are Performance characteristics within bounds?<o:p></o:p>
Good tests are A TRIP<o:p></o:p>
l Automatic<o:p></o:p>
l Thorough<o:p></o:p>
l Repeatable<o:p></o:p>
l Independent<o:p></o:p>
l Professional<o:p></o:p>
CORRECT Boundary Conditions<o:p></o:p>
l Conformance . Does the value conform to an expected format?<o:p></o:p>
l Ordering . Is the set of values ordered or unordered as appropriate?<o:p></o:p>
l Range . Is the value within reasonable minimum and maximum values?<o:p></o:p>
l Reference . Does the code reference anything external that isn't under direct control of the code itself?<o:p></o:p>
l Existence . Does the value exist? (e.g., is non-null, non-zero, present in a set, etc.)<o:p></o:p>
l Cardinality . Are there exactly enough values?<o:p></o:p>
l Time (absolute and relative) . Is everything happening in order? At the right time? In time?<o:p></o:p>
分享到:
相关推荐
Pragmatic Unit Testing in Java 8 With JUnit steps you through all the important unit testing topics. If you've never written a unit test, you'll see screen shots from Eclipse, IntelliJ IDEA, and ...
Pragmatic Unit Testing With C#_Edited.pdf
Pragmatic Unit Testing in Java 8 with JUnit 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有...
《实用程序员:Java中的JUnit实用单元测试》一书由Andy Hunt和Dave Thomas撰写,是针对Java开发者关于单元测试的一部详尽指南。本书的核心在于强调了单元测试的重要性,并提供了使用JUnit进行有效单元测试的实践方法...
《Pragmatic Unit Testing in C# with NUnit》是一本深入探讨C#编程中单元测试实践的书籍,专注于使用NUnit框架进行高效的单元测试。NUnit是.NET开发领域中最流行的单元测试框架之一,它为开发者提供了丰富的功能来...
《Pragmatic Unit Testing in Java with JUnit》是一本专注于Java单元测试实践的书籍,其配套源代码提供了丰富的示例和实践案例,帮助读者深入理解如何有效地使用JUnit进行单元测试。JUnit是Java领域最广泛使用的...
另一个文件"Pragmatic.Bookshelf.Pragmatic.Unit.Testing.in.C.Sharp.with.NUnit.2nd.Edition.Aug.2007.eBook-BBL"则是电子书本身,包含了详细的章节内容和深入的讨论。 总的来说,《单元测试之道C#版:使用NUnit》...
### JUnit 与《Pragmatic Unit Testing》详解 #### 一、前言与背景介绍 《Pragmatic Unit Testing》是一本针对JUnit框架进行深入讲解的书籍,它由Andy Hunt和Dave Thomas合著,由The Pragmatic Bookshelf出版。这...
《Pragmatic Unit Testing in Java》是编程领域中一本经典的著作,由知名程序员Andy Hunt和Dave Thomas撰写。这本书深入探讨了单元测试的重要性和实践方法,特别是针对Java编程语言。单元测试是软件开发过程中的关键...
pragmatic unit testing with c# using NUNIT.
Pragmatic Unit Testing in Java 8 with JUnit 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
### Pragmatic Unit Testing in C# with NUnit #### 核心知识点概述 本书《Pragmatic Unit Testing in C# with NUnit》由Andy Hunt和Dave Thomas合著,旨在为软件开发人员提供一个全面、实用的单元测试指南。通过...
### Pragmatic Unit Testing in Java with JUnit:深入解析与实战指南 #### 一、单元测试基础概述 《Pragmatic Unit Testing in Java with JUnit》这本书为读者提供了全面而实用的单元测试指南,适用于Java开发...
《Pragmatic Unit Testing in Java with JUnit》是一本专注于Java单元测试的指南,它深入讲解了如何有效地利用JUnit框架进行测试驱动开发(TDD)。JUnit是Java领域中最广泛使用的单元测试框架,它为开发者提供了编写...
《Pragmatic Unit Testing(单元测试之道)》是《Paagmatic Starter Kit(程序员修炼三部曲)》系列中的一个重要组成部分,专注于教导开发者如何高效、实际地进行单元测试。单元测试是软件开发过程中的关键环节,它...
Pragmatic Unit Testing in C# with NUnit Andy Hunt Dave Thomas
《Pragmatic Project Automation》是一本专注于项目自动化实践的书籍,其总结篇章旨在提供一个精炼的概述,帮助读者理解如何高效地运用自动化工具和技术在软件开发过程中提升效率。这篇博文作者通过iteye博客分享了...
关于如何测试JavaScript模块和应用程序的实用指南 本指南的目的是就如何编写测试提供一些简单,易于遵循的指南。 当前,该文档专门涵盖了JavaScript项目的测试,但是大多数方面也应适用于其他语言。...