Completamos con esta entrada la serie sobre test unitarios, centrándonos en el Framework DUnitX, que es el que actualmente embarcadero recomienda y se incluye en las últimas versiones de Delphi.
Test Unitarios; Introducción (Entrega 1)
Test Unitarios; Framework DUnit (Entrega 2)
Convertir Test de DUnit a DUnitX (Entrega 3)
Test Unitarios; Framework DUnitX (Entrega 4)
INTRODUCCION
Como ya he comentado en las entradas anteriores, DUnitX es una evolución de DUnit (y que además recoge idea...
¿Qué es un test unitario?
El objetivo más a corto plazo de un test unitario (o prueba unitaria) es el de probar una porción de nuestro código, de forma que podamos comprobar que funciona correctamente y que se ejecuta con el comportamiento para el que fue diseñado. Por lo tanto nos ayuda a encontrar fallos en nuestro código. Podríamos decir que un objetivo más amplio de los test unitarios es, en general, mejorar la calidad del software que desarrollamos. Por un mejor diseño y por un menor núme...
Today's developer skill sprint is "Behavior-Driven Development (BDD) with Roman Yankovsky". Roman Yankovsky is one of our Embarcadero MVPs in Saint Petersburg, Russia. Roman gave an overview of his DelphiSpec library for automated testing and also mentioned Gherkin "a Business Readable, Domain Specific Language that lets you describe software’s behavior without detailing how that behavior is implemented."
Here are the links that Roman included at the end of his skill sprint presentation:
...
Next Wednesday, Nick Hodges, Embarcadero MVP and author of the new book, "Coding in Delphi", will present "RAD in Action: Unit Testing in Delphi" in 3 live online sessions.
Date: Wednesday, February 12, 2014
Times:
6AM San Francisco / 9AM New York / 2PM London / 3PM Milan
11AM San Francisco / 2PM New York / 7PM London / 8PM Milan
5PM San Francisco / 13-Feb 10AM Tokyo / 13-Feb 12PM Sydney
Without unit tests your code is fragile, hard to change, and unreliable. Unit testing is the...
In honor of the many talented contributors to the ISO C++ standard, STL, Boost, Clang, LLVM and everything else that helps make C++11 much more easy to teach, learn and use and also to our C++Builder XE3 engineering team for the release of our C++ 64-bit compiler for Windows, I offer this short poem on this day before C++mas. My apologies, in advance, to Clement Clarke Moore, all English teachers and poets galore.
Twas the Night Before C++Mas
Twas the night before C++mas, when throughout th...
With the upcoming release of our new C++Builder compiler for 64-bit Windows (will have C++11 standard support), Embarcadero Technologies continues our commitment for the C, C99 and C++ languages that started on May 13, 1987 with the first release of Turbo C version 1.0. The C++Builder 64-bit Windows compiler is coming soon.
For the past 25+ years, we have continued to innovate with industry leading development environments, compilers, tools, run-time libraries and tool chains. Today and int...
So imagine you've been asked to implement the following requirement:
When a to-do list item is marked as complete, the CompletedOn date time property shall be set to the current time.
That doesn't sound so hard to implement, but how can I test it? I don't know precisely what the value of the CompletedOn property "should be" since I don't know precisely when the Complete setter will run.
Method #1: Fuzzy Logic
One option would be to see if the value is "close enough":
var todo = new TodoIt...
On June 2, 2011 the US Department of Labor's Bureau of Labor Statistics reported a 1.8% (annual rate) increase in non-farm business sector labor during the first quarter of 2011. For the manufacturing sector there was a 4.2% growth in productivity for Q1 2011. Most businesses measure the productivity of their employees. In Software Project Management we can measure the completion of development milestones, feature completion, bug close ratios, check-ins, and other aspects of developing software...
Continuing my month of July theme about wanting more, this time it is Toys. Peter Pan, by J.M. Barrie, said he would never grow up, never grow up, never grow up, not me ("I Won't Grow Up"). That's me in spades. I suspect that many developers also have a lot of kid inside themselves. We have toys. We want more toys. My list includes nerf weapons, fishing rods and reels, frisbees, scuba gear, and golf clubs.
For technical toys most developers probably have a smart phone, an iPad, AppleTV...
Html helpers for ASP.NET MVC are static extension methods, which frequently reference the ViewContext and HttpContext. Combined, this can make unit testing a bit tricky. Let's write a new Html helper using a test-first methodology. Let's start with a prototype function:
public static MvcHtmlString MyTable(this HtmlHelper helper, MyModel model, IDictionary<string, object> htmlAttributes)
{
return MvcHtmlString.Empty;
}
I've added just enough cod...