| |
browse.develop.com
Browse.develop.com is a community that was established to collect and
organize valuable web information. Our technical staff have selected and
indexed information and courses that they feel will help you stay
current on best practices across the SDLC.
|
9 Articles match "Unit Testing"
See all articles with
"Unit Testing"
| The Latest from Llewellyn Falco's Approval Tests | MORE | | What’s New in Java ApprovalTests V 0.12 Unit Testing HadoopMapReduce Before we go into the details of everything involved in HadoopMapReduce, let’s go through an overview of how we’ve been testing our MapReduce jobs. Visualizing the System Unit Testing provides many different advantages to a programmer. In particular, with MapReduce, being able to understand the flow and transformation of the data can be more enlightening than the other aspects of Unit Testing. To demonstrate this, I’m going to start output of my word count unit test. Specifically, it’s a big data thing. DevelopMentor Courses - Wednesday, September 19, 2012 Testing Difficult Code I recently did 3 videos in my ‘ Using ApprovalTests in.Net’ series that deal with how to test difficult code. These video actually have very little to do with either.Net or ApprovalTests, but they are common issues you run into when unit testing. Seams Testing difficult Code comes down to 2 things: Can I call the Method? The Peel The hardest part about long methods is you have to run all of it to test even a small part of it. The Slice (Mocks) Even if you get into the piece you are looking to test, you might not be able to get all the way through it. DevelopMentor Courses - Wednesday, March 21, 2012 Testing Asp.Net pages Here is the strategy I’ve been using for unit testing Asp.Net pages. Aspx pages were almost intentionally made to be hard to test, so the result is as elegant as is possible for the given situation. Note : If you want to test something that isn’t the “end result” of a web page, simply pull that logic into a separate classmethoddll and test it normally. This is for testing the final output of the page. The Bottom Line : The following 1 line will test the AspxClass for a given scenario. Step 4) Turn on the local test server and then run the tests. DevelopMentor Courses - Sunday, July 3, 2011 | | The Best from Llewellyn Falco's Approval Tests | MORE | | Complete Unit Testing vBlogged my thoughts here: I'm using the LegacyApprovals package (which I wrote, download below) here to test every combination of the possible parameters. It's design to test a lot of cases, but not every case. Links: Approval Tests (Legacy Approvals is part of the standard ApprovalTest download.) Today I had a conversation with @WoodZuill where an extremely rare situation came up. situation where you can practice TDD with Completeness of the possible user scenarios. It's worth pointing out this is NOT what the LegacyApprovals package was actually made for. DevelopMentor Courses - Tuesday, December 7, 2010 Testing Difficult Code I recently did 3 videos in my ‘ Using ApprovalTests in.Net’ series that deal with how to test difficult code. These video actually have very little to do with either.Net or ApprovalTests, but they are common issues you run into when unit testing. Seams Testing difficult Code comes down to 2 things: Can I call the Method? The Peel The hardest part about long methods is you have to run all of it to test even a small part of it. The Slice (Mocks) Even if you get into the piece you are looking to test, you might not be able to get all the way through it. DevelopMentor Courses - Wednesday, March 21, 2012 Why Write Unit Tests? Why Write Unit Tests? I've made a small video to go with this post Approval Tests have allowed us to focus on the parts of testing at a much higher level of abstraction. The benefits of Automated Tests are one of the areas that we can now more clearly appreciate. There are 4 main areas programmers can benefit from using Automated Tests (Unit and otherwise) Specifications Feedback Regression Granularity Let's talk about each of these. Well, you can't do better than a running, failing unit test. First, there is Specifications. Llewellyn Falco's Approval Tests - Sunday, June 21, 2009 | - What’s New in Java ApprovalTests V 0.12
Unit Testing HadoopMapReduce Before we go into the details of everything involved in HadoopMapReduce, let’s go through an overview of how we’ve been testing our MapReduce jobs. Visualizing the System Unit Testing provides many different advantages to a programmer. In particular, with MapReduce, being able to understand the flow and transformation of the data can be more enlightening than the other aspects of Unit Testing. To demonstrate this, I’m going to start output of my word count unit test. Specifically, it’s a big data thing. DevelopMentor Courses - Wednesday, September 19, 2012 - Hello JRack
Simple To Test & Reuse But what if you unit test this code? Whats more we've added approval test support so you can simple approve the resulting html. Put this code into a JUnit test class: public void testHelloWorld() throws Exception { Approvals.approve(new HelloWorldRack ().call(null)); call(null)); } Okay - simple to write, simple to run, simply to test. also encourage you to look at the test examples hereToday Woody Zuill and myself put some of the finishing touches on a port of Rack to Java, and published it to the world. - Testing Asp.Net pages
Here is the strategy I’ve been using for unit testing Asp.Net pages. Aspx pages were almost intentionally made to be hard to test, so the result is as elegant as is possible for the given situation. Note : If you want to test something that isn’t the “end result” of a web page, simply pull that logic into a separate classmethoddll and test it normally. This is for testing the final output of the page. The Bottom Line : The following 1 line will test the AspxClass for a given scenario. Step 4) Turn on the local test server and then run the tests. DevelopMentor Courses - Sunday, July 3, 2011 - Approving the Weather
How can I test the weather? So how do we test this? The unfortunate part is this doesn't actually test the weather at all. It 'only' allows us to test the entire rest of the app in hopes that the encapsulated piece will work. Let's take a look at a new way to actually test the Weather API using approvals. class WeatherLoader { getQuery(); // returns the query that's used to get the weather execute(query); // executes the given query to get the weather } Now we're going to write a test that exercises this. new approach. Query: GetCityWeather?city=San%20Diego - Approval Tests (a pictures worth a 1000 tests) [repost]
Scenario 1 [Testing a User Interface] Core Concept : Component gui = createGui(); Approvals.approve(gui); This creates a snap shot of the gui: gui.received.png This passes if gui.received.png == gui.approved.png If you like the result, simply rename gui.received.png -> gui.approved.png and the test will pass. a picture is worth a 1000 tests”. Ever find that your unit tests aren’t giving you enough security? Ever find your tests test too many things and the maintenance required to change anything is actually reducing your agility? oh wait! - Talk at XPSD Thrusday Nov 6th
we are giving a talk on approval tests at XPSD Thursday Nov 6th at 6pm, here's the teaser. Approval Based Tests Write your code, run it, see that it works. The addition of 1 line of code can now make that a repeatable automated regression test! Well tested code has been shown, over and over, to improve the quality and maintainability of software. Yet most projects are not well tested. Too often programmers feel that testing imposes too high of an overhead on writing code. After that, maintaining the test becomes equally cumbersome. Why is this? %>
101 Articles match "Unit Testing"
See all articles with
"Unit Testing"
| The Latest from DevelopMentor | MORE | | Unit testing code depending on the ASP.NET #WebApi HttpClient 'In a previous post I showed how to unit test an ASP.NET WebAPI Controller. Assuming for a moment the client part is also written in C# we should test that as well. Testing the BooksClient class. If we want to test this class we need to pass in an HttpClient object. This might not sound like a big deal but as this class doesn’t implement an interface we can’t use most of the standard mocking frameworks like Moq to replace the HttpClient with a test fake. Testing the GetBooks() function. test is pretty simple. Testing am HTTP POST action. The Problem Solver - Monday, May 20, 2013 Unit testing a ASP.NET WebAPI controller Testing a simple ApiController that gets data Suppose we have the following ASP.NET WebAPI Controller with two Get methods, the first returns the complete list of books and the second returns the book with the requested ID. Testing the Get() method. The Get() method that returns all books is easy enough to test. Testing the Get(id) method. Testing for getting with an invalid ID is equally simple: 1: [TestMethod]. Testing an HTTP PUT operation. Testing an update using an HTTP put is just as simple as a testing a get action. 8: 9: }. 11: {. The Problem Solver - Sunday, May 12, 2013 Agile Clinic: Dear Allan, we have a little problem with Agile. Sprints last three weeks, including planning, development and testing. planning, development and testing” Good, but I immediately have two lines of enquiry to peruse. Second: testing should come before development, well, at least “test scripts”, and it should be automated so if it comes after development it is trivial. Testing again: do the devs know the end conditions? Is it not done because it hasn’t finished dev or test? Sounds like too much is being taken into the sprint Are the devs practicing automated test first unit testing? Allan Kelly's Blog - Sunday, April 28, 2013 | -
| The Best from DevelopMentor | MORE | - Significant Advances in Unit Testing Windows Workflow
This post describes a unit testing library for testing Windows Workflow Foundations. Rather it's a library that can be used in conjunction with any of these testing frameworks. Download the library with sample test project here: Kennedy.WorkflowTesting.zip (216 KB). First a Little History: Last September I posted this teaser entitled Unit Testing Coming to a Workflow Near You. In that previous post, I highlighted what I could determine to be the current state-of-the-art with regard to unit testing workflows, circa September 2008. Michael C. Kennedy's Weblog - Sunday, January 18, 2009 - Article: Avoiding 5 Common Pitfalls in Unit Testing
Llewellyn Falco and I recently wrote an article for DevelopMentor's Developments newsletter entitled Avoiding 5 Common Pitfalls in Unit Testing. Avoiding 5 Common Pitfalls in Unit Testing. When I started out with unit tests, I was enthralled with the promise of ease and security that they would bring to my projects. In practice, however, the theory of sustainable software through unit tests started to break down. Unit Tests have become more trouble than they are worth.". When tests would stop working, we just ignored them. Michael C. Kennedy's Weblog - Thursday, August 6, 2009 - Unit Testing Coming to a Workflow Near You
[Update: See the follow up post "Significant Advances in Unit Testing Windows Workflow" ]. However you won't find very much support for Test Driven Development (TDD) or unit testing in general. In fact the architecture that makes Windows Workflow powerful (strict separation of workflow, activities, and the host for example) really gets in the way of unit tests. There has been some work done on unit testing Windows Workflows. Here's some links: Unit Testing Activities with Windows Workflow Foundation by Ron Jacobs. Michael C. Kennedy's Weblog - Tuesday, September 30, 2008 - TDD Invades Space Invaders
As a follow-up to our " Avoiding 5 Common Pitfalls in Unit Testing " article we did a webcast where we took a problem from the audience and solved it live and unrehearsed on stage. The thing to remember is that all of this was done for the sole purpose of creating a recipe for a scenario we could test. Create a new test project. We made it to step 4 during our presentation (download code below) and estimate another 15 minutes would have had the whole scenario done, tested, and well-factored. Tags: DevelopMentor Screencasts Talks Unit Testing Michael C. Kennedy's Weblog - Wednesday, October 28, 2009 - Test-Driven Cameras
wish people had this same reaction to the idea of writing code without first writing tests (TDD). Tests give you the chance: To see what you are going to write, BEFORE you write it. If you haven’t already, here’s a great place to start learning to Test-Driven Development ? If you are already writing tests, here’s a free library to make test even easier to write? Unit Testing TDDI am getting old. The other day I was hanging around with my friend, Ike Ellis. He told me a story about his kids. The first question they asked was “Where is the picture?” DevelopMentor Courses - Wednesday, September 7, 2011 %>
| | |