Your SlideShare is downloading. ×
0
Agile Tools
Allan Spartacus Mangune
Delivery
• Lectures and demos – 3 hours
• 3 case studies and hands-on exercises – 1 hour each
Agenda
Test-driven Development & Unit Testing
Version Control & Continuous Integration Testing
Web Performance & Load Test...
Test-driven Development
Similar to test-first
practice in Extreme
Programming
Designed for
product
development with
short ...
Development Cycle
Write a test
Run all tests
Write some
code
Run test
Refactor
Repeat
Write A Test
Write a failing unit test for each new
functionality
• The test must cover the requirements and how
exception...
Run All Tests
Ensures that the test harness is working
and the new unit test actually fails
• Pending the writing of corre...
Write Some Code
Based on the new functionality to be
developed, write the program code
The objective is to code enough to ...
Run Test
Run the test to verify that the written code passes
the test unit test
• If the test fails, review the code again...
Refactor
When the code is passing the test, refactor to the
desired standard
• Code follows coding standard
• No duplicate...
Repeat
Repeat the cycle.
• Write a new unit test for a new functionality
Each cycle should be very short
• Few code edits ...
Test Structure
Arrange
• Setup and initialize the desired state prior to testing
Act
• Execute the test against the method...
Fakes and Mocks
Isolate code
• Controls what is failing and where it is happening
Replaces other parts of the system with ...
Visual Studio Unit Test Explorer
Unit Test Explorer
Create and run a unit test
Isolating Code Under Test with Microsoft Fakes
Create and Run Unit Test (1)
Create a test
project
Create a test
class
Create a test
method against a
functionality
Run te...
Create and Run Unit Test (2)
Create a test
project
Create a test
class
Create a test
method against a
functionality
Run te...
Arrange, Act, Assert
Arrange
• Define the test input
Act
• Run the method under test
Assert
• Verify the result
Demo: Visual Studio Unit Test
Explorer
Case Study & Hands-on Exercises
Version Control
Management of changes to source files
Each change is marked with change set or revision number
• A revisio...
Continuous Integration Testing
Continuous integration is a process wherein
the development team continuously integrate
the...
Team Foundation Server
Version Control
Team Foundation Server Version Control
(TFSVC)
Manage multiple revisions to source files
• Check-ins
• Branching and mergi...
How to Use TFSVC?
Set up development workspace
Create the version control of your app’s solution files
Create a new soluti...
Set up Development Workspace
Access the Team Explorer in
Visual Studio
• Connect to a Team’s project
Map the team’s projec...
Create the Version Control
Access the Source Control Explorer and
create the main trunk
Check in files to the main trunk
Create a New Solution Under Version
Control
Create a new project Add the project to a version control
Put an Existing Solution to the Version Control
Open your solution
Access the solution’s property page
and add the solutio...
Contribute source files (changes)
Access the pending
changes in solution or
project
Relate change set to one
or more work ...
Branching
Manage simultaneous work of different teams
from the same code base
Merge changes from a branch to the main
trunk
Resolve Version Control Conflicts
Conflicts are highlighted
when checking in pending
changes
Access the Resolve Conflicts
...
Demo: Team Foundation Server
Version Control
Continuous Integration Testing
with TFS Build Service
Using the Build Service for Continuous
Integration Testing
Create or edit a build definition
On Build triggers, set contin...
Create or Edit Build Definition
Access the Builds tab
from Team Explorer
Create a new build
or edit a new one
Set the buil...
Continuous Integration Trigger
Access the Trigger tab Select Continuous Integration
Gated Check-in
offers a stricter
check...
Demo: Continuous Integration
Testing with TFS Build Service
Case Study & Hands-on Exercises
Web Performance and Load
Testing
Web Performance and Load Testing
Record web performance tests
Add a load test
Run load test
Analyze test results
Web Performance Test
Create a web performance
and load test project
Record a web performance
test
Load Test (1)
Create a load
test
Choose a
load pattern
Add a test
mix
Plug the web
performance
test
Run the load
test
Anal...
Load Test (2)
Create a load
test
Choose a
load pattern
Add a test
mix
Plug the web
performance
test
Run the load
test
Anal...
Demo: Web Performance and
Load Testing
Case Study & Hands-on Exercises
References
Test-driven development - http://en.wikipedia.org/wiki/Test-driven_development
http://en.wikipedia.org/wiki/Con...
Copyright (C) 2014. Allan Spartacus Mangune
This work is licensed under a Creative Commons Attribution-
NonCommercial-Shar...
Upcoming SlideShare
Loading in...5
×

Agile Tools

303

Published on

Published in: Software, Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
303
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
11
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Agile Tools"

  1. 1. Agile Tools Allan Spartacus Mangune
  2. 2. Delivery • Lectures and demos – 3 hours • 3 case studies and hands-on exercises – 1 hour each
  3. 3. Agenda Test-driven Development & Unit Testing Version Control & Continuous Integration Testing Web Performance & Load Testing
  4. 4. Test-driven Development Similar to test-first practice in Extreme Programming Designed for product development with short iterations Write failing test code for desired functionality Write code to past the test Refactor code to desired coding standard
  5. 5. Development Cycle Write a test Run all tests Write some code Run test Refactor Repeat
  6. 6. Write A Test Write a failing unit test for each new functionality • The test must cover the requirements and how exceptions are handled in the software product Developer must have a correct understanding of the functionality • Refer to use case, domain models and details of the user story Write a test Run all tests Write some code Run test Refactor Repeat
  7. 7. Run All Tests Ensures that the test harness is working and the new unit test actually fails • Pending the writing of correct program code Write a test Run all tests Write some code Run test Refactor Repeat
  8. 8. Write Some Code Based on the new functionality to be developed, write the program code The objective is to code enough to pass the unit test • Any duplicate code at this point must be refactored later Write a test Run all tests Write some code Run test Refactor Repeat
  9. 9. Run Test Run the test to verify that the written code passes the test unit test • If the test fails, review the code against specific requirements and test cases and make the necessary modification • Re-run the test Write a test Run all tests Write some code Run test Refactor Repeat
  10. 10. Refactor When the code is passing the test, refactor to the desired standard • Code follows coding standard • No duplicate code • Make design changes to improve the overall maintainability of the system Rerun all the tests after refactoring • To ensure that all tests are passing Write a test Run all tests Write some code Run test Refactor Repeat
  11. 11. Repeat Repeat the cycle. • Write a new unit test for a new functionality Each cycle should be very short • Few code edits and less that an hour • A long cycle may prompt the developer to resort to debugging Write a test Run all tests Write some code Run test Refactor Repeat
  12. 12. Test Structure Arrange • Setup and initialize the desired state prior to testing Act • Execute the test against the method being tested Assert • Determines the outcome of the test [TestClass] public class HomeControllerTest { [TestMethod] public void Index() { // Arrange HomeController controller = new HomeController(); // Act ViewResult result = controller.Index() as ViewResult; // Assert Assert.IsNotNull(result); } …. }
  13. 13. Fakes and Mocks Isolate code • Controls what is failing and where it is happening Replaces other parts of the system with stubs and shims • Stub - A class replacement with the same interface • Shim – Used to replace the actual method call with the fake ones
  14. 14. Visual Studio Unit Test Explorer
  15. 15. Unit Test Explorer Create and run a unit test Isolating Code Under Test with Microsoft Fakes
  16. 16. Create and Run Unit Test (1) Create a test project Create a test class Create a test method against a functionality Run test
  17. 17. Create and Run Unit Test (2) Create a test project Create a test class Create a test method against a functionality Run test
  18. 18. Arrange, Act, Assert Arrange • Define the test input Act • Run the method under test Assert • Verify the result
  19. 19. Demo: Visual Studio Unit Test Explorer
  20. 20. Case Study & Hands-on Exercises
  21. 21. Version Control Management of changes to source files Each change is marked with change set or revision number • A revision is made to one or more source files A change set is usually accompanied by a unique ID, timestamp, and the name of the person who committed the revision Changes to one or more source files can be reverted to specific version
  22. 22. Continuous Integration Testing Continuous integration is a process wherein the development team continuously integrate their source files to a version control system • Allows the team to work on the latest version of the software • Delays due to late integration are avoided Use an automated build system to continuously run automated integration tests • Breaking changes are uncovered and fixed • Rules can be implemented to prevent source files that break the build from committed to the version control system Source Files Version Control Server Automated Build Server Build is broken
  23. 23. Team Foundation Server Version Control
  24. 24. Team Foundation Server Version Control (TFSVC) Manage multiple revisions to source files • Check-ins • Branching and merging • Shelving Contributor • Check out files • Check in modified or new files • Delete source files • Compare source files • Merge changes between files
  25. 25. How to Use TFSVC? Set up development workspace Create the version control of your app’s solution files Create a new solution under version control Put an existing solution to the version control Contribute source files Isolate risks by branching from trunk Resolve version control conflicts
  26. 26. Set up Development Workspace Access the Team Explorer in Visual Studio • Connect to a Team’s project Map the team’s project to a local folder • Developer’s PC Map the workspace to get the project’s source files
  27. 27. Create the Version Control Access the Source Control Explorer and create the main trunk Check in files to the main trunk
  28. 28. Create a New Solution Under Version Control Create a new project Add the project to a version control
  29. 29. Put an Existing Solution to the Version Control Open your solution Access the solution’s property page and add the solution to TFSVC
  30. 30. Contribute source files (changes) Access the pending changes in solution or project Relate change set to one or more work items Check in the pending changes. Adding comment helps
  31. 31. Branching Manage simultaneous work of different teams from the same code base Merge changes from a branch to the main trunk
  32. 32. Resolve Version Control Conflicts Conflicts are highlighted when checking in pending changes Access the Resolve Conflicts link Resolve conflicts by keeping local version, server version or merge conflicts
  33. 33. Demo: Team Foundation Server Version Control
  34. 34. Continuous Integration Testing with TFS Build Service
  35. 35. Using the Build Service for Continuous Integration Testing Create or edit a build definition On Build triggers, set continuous integration
  36. 36. Create or Edit Build Definition Access the Builds tab from Team Explorer Create a new build or edit a new one Set the build definitions
  37. 37. Continuous Integration Trigger Access the Trigger tab Select Continuous Integration Gated Check-in offers a stricter check in policy
  38. 38. Demo: Continuous Integration Testing with TFS Build Service
  39. 39. Case Study & Hands-on Exercises
  40. 40. Web Performance and Load Testing
  41. 41. Web Performance and Load Testing Record web performance tests Add a load test Run load test Analyze test results
  42. 42. Web Performance Test Create a web performance and load test project Record a web performance test
  43. 43. Load Test (1) Create a load test Choose a load pattern Add a test mix Plug the web performance test Run the load test Analyze the results of the test
  44. 44. Load Test (2) Create a load test Choose a load pattern Add a test mix Plug the web performance test Run the load test Analyze the results of the test
  45. 45. Demo: Web Performance and Load Testing
  46. 46. Case Study & Hands-on Exercises
  47. 47. References Test-driven development - http://en.wikipedia.org/wiki/Test-driven_development http://en.wikipedia.org/wiki/Continuous_integration http://en.wikipedia.org/wiki/Extreme_programming_practices#Continuous_integration Use Team Foundation Version Control - http://msdn.microsoft.com/en- us/library/ms181237(v=vs.120).aspx Unit Test - http://msdn.microsoft.com/en-us/library/dd264975.aspx Build Service - http://msdn.microsoft.com/en-us/library/ms181709.aspx Performance and load testing - http://msdn.microsoft.com/en-us/library/dn250793.aspx
  48. 48. Copyright (C) 2014. Allan Spartacus Mangune This work is licensed under a Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International License. License URL: http://creativecommons.org/licenses/by-nc- sa/4.0/
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×