Join Bruce Van Horn for an in-depth discussion in this video What is unit testing?, part of C# Essential Training: 2 Flow Control, Arrays, and Exception Handling.
- [Instructor] I want to introduce you to the concept of unit testing. If you've never heard of this practice before, it's part of a broader scope of programming practices called Agile development. And in that context, unit testing becomes an integral part of your development process in a practice called test-driven development or TDD. In test-driven development, you develop your code in simple phases. So generally the first thing you do is you create some code or you change some existing code, and then you create a repeatable test.
Now this is in a separate code project. It's an actual code test that actually exercises the code that you write and proves that it works the way that it's supposed to. Visual Studio has a facility that allows you to run these tests and view the results. And from there, based on whether or not your tests pass or fail, you repeat the process, either fixing problems or mistakes that you've made or moving on to the next feature that you're supposed to develop. When you practice test-driven development, your goal is to have 100% coverage.
This means that all exposed methods in your project have unit tests written that exercise them fully. Unit tests can be run from within Visual Studio for developer productivity, or you can automate them as part of a continuous integration process using tools like Jenkins, TeamCity, or Team Foundation Server.
AuthorBruce Van Horn
- Writing unit tests in C#
- Working with simple and multidimensional arrays
- Managing ordered and unordered data with lists
- Evaluating conditions with if-else statements
- Using OR, AND, and NOT operators
- Building loops
- Debugging and handling exceptions
- Creating the final build of your C# project
Skill Level Beginner
C# Object-Oriented Programming Tips and Trickswith Jesse Freeman58m 39s Intermediate
1. Unit Testing and Test-Driven Development
2. Arrays and Collections
3. Flow Control
4. Exception Handling
5. Getting to Production
Next steps1m 57s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.