text
stringlengths
1
330k
• integration tests for the repository (persistence)
• unit tests for the web controllers (REST API)
• unit tests for the application service
• unit tests for the validator
By integration tests, I mean tests that target a fully functional application deployed on a production-like environment. By unit tests, I mean tests that target individual classes for which collaborators / dependencies have been replaced by test doubles (mocks, stubs, whatever).
Clearly, every test has a different perspective (user-centric for web tests, API consumer-centric for API tests, developer-centric for others) and validates different assertions (HTML element contents for web tests, HTTP responses and status codes for API tests, database contents and exceptions for application tests, e...
So we end up wondering how useful writing all these tests will be and how we can be more efficient in our approach. What is your take on this?
I realize this is more a discussion-type question than one that has a clear and verifiable answer, so if this is not the appropriate forum, would you please direct me to the best forum for these discussions.
share|improve this question
extending this question: do you know good and bad examples of test redundancy? –  k3b Jan 24 '12 at 6:31
add comment
3 Answers
As you suspect, there are no magic bullet answers to your question, but I can offer some suggestions to consider.
• Wherever possible, look to code any particular action exactly once and reuse it multiple times.
• Whereever possible, drive your tests with a combination of object-oriented and data-driven test code.
• Where you can string together a sequence of unit-level tests and functional tests, do this: if you can code your functional actions in the form of a function to click a link, and pass in the page, link information, and expected result from a text file you'll need precisely one unit of code to handle clicking a link...
• If multiple test runs are exercising the same part of the application, make the data validation part of exactly one run.
• Document your testing as you go. I'm working with a script codebase that's got over half a million lines of code, almost as many lines of data and performs about that many test cases, most of it poorly documented if there's any documentation at all. Working out which bit does what is such a pain that there's a lot ...
Hopefully that gives you a good starting point to consider.
share|improve this answer
add comment
Writing and maintaining automated tests is a big investment and it is ok to start slowly
It is expensive to write and maintain automated tests. If the tests are written in an ineffective way, the investment may not pay off. Similarly, if the tests require a great deal of maintenance, either because of how the tests are written or because the interfaces under test are changing quickly, your investment may n...
Automated UI tests are especially fragile, and you still need to test manually
In my experience, UI tests tend to be more fragile than API-level tests. Browers continue to evolve, and it seems to me that every new browser release requires changes to Selenium, and sometimes changes to my tests as well. If the HTML does not use element IDs in the appropriate places, your test must identify elements...
On top of that, some aspects of the UI will still require human scrutiny: layout, wording, use of color, fonts, and graphics, and usability.
Testing is a means to an end, not an end in itself
Our jobs are difficult and complex, and it is tempting to look for absolute answers that will solve problems unconditionally. However, each developer and each project are different. Some developers like to code fast and use automated tests to find mistakes. Other developers may think for a long time before writing a si...
Moreover, even for the same developer, there may be variation in the quality of their work depending on what they are working on.
I once believed that everyone should write automated tests for everything, but after working with a variety of teams of different sizes, skills and experiences, I believe the right answer is more complicated and messy.
Consider writing automated tests when any other kind of testing is time-consuming, error-prone, and/or repetitive
Some problems lend themselves more readily to automated testing than others. Focusing on areas that are clearly difficult to test by any other means will help you make good investments in your valuable time.
Talk to each other
Some duplication of effort is inevitable if you are ambitious about testing, but you can reduce it by talking to each other about what you test.
share|improve this answer
add comment
I wouldn't worry about redundant tests at first. It's much better to test a piece of code twice than not at all. The only way to accurately determine whether your tests are redundant is by using a code coverage tool (or extensive logging). However, as Kate Paulk states, there are no magic/silver bullets with testing, o...
However, I completely agree that soup-to-nuts testing is useful. I wouldn't trust a test/dev team that believed that modular/unit/integration testing was sufficient to validate the stability of a system. The big question is, how much of that effort should you automate and when. I know it sounds completely primitive, bu...
Anyway, if you start out with a general plan for your test harness, and you add in some coverage analysis, the refactoring should become obvious somewhere down the line. Also, another caveat, beware of testers/developers/contractors who want to build system level tests without having a general idea of how the system sh...
share|improve this answer
add comment
Your Answer
Lima's Rock Station
United Nations
United Nations
Scoring a deal with a label is, for the most part, what every band hopes for. A bit of security, financial reward for a hard fought creative endeavor, or simply just a bit of fame and some notoriety -- whatever the reason -- a record contract can (sometimes) mean the difference between having to wor...
Share Email Bookmark
Personal tools
Parametric polymorphism
From HaskellWiki
(Difference between revisions)
Jump to: navigation, search
(Moved content to Polymorphism)
Line 1: Line 1:
Parametric polymorphism is when a function's type signature allows various arguments to take on arbitrary types, but the types must be ''related'' to each other in some way.
#REDIRECT [[Polymorphism#Parametric polymorphism]]
For example, in Java one can write a function that accepts two arguments of any possible type. However, Haskell goes further by allowing a function to accept two arguments of any type so long as they are both ''the same'' type. For example
As a specific (and slightly more complicated) example, the well-known <hask>map</hask> function has a parametrically polymorphic type
which means that the function will accept ''any'' type of list and ''any'' type of function, '''provided''' the types match up. (That is, the function's argument type and the list's element type match.) This makes <hask>map</hask> highly polymorphic, yet there is still no risk of a runtime type mismatch.
Latest revision as of 21:39, 4 September 2012
1. REDIRECT Polymorphism#Parametric polymorphism
Simms Solarflex Hoody
Be the first to Write a Review
Long hot days in the salt can feel like a desert inferno on your face and uncovered extremities. The SolarflexTM Hoody keeps you cool and covered with an elongated neck that acts as a highly breathable sun gaiter, and finger loops built into motion-enhancing Raglan sleeves for enhanced armor against prolonged sun expos...
Wasabi- Simms Solarflex Hoody
Base Image /s/i/simms-solarflex-hoody-wasabi-1_10.jpg
Browsing Posts in Mental, Emotional, and Social Life
by Stephen Wells
Our thanks to the Animal Legal Defense Fund (ALDF) for permission to republish this post, which originally appeared on the ALDF Blog on November 21, 2013. Wells is Executive Director of the ALDF.
In pursuit of the next new thing, the next thrilling adventure, the next risky endeavor, some are turning to extreme animal sports like running from bulls. These spectacles are brought to us by a company known as Great Bull Run, LLC, a business ventured started by two former attorneys who tired of their profession and ...
Entertainment or abuse? Running of the bulls in Pamplona Spain, on January 27, 2008 (CC Mike Brice)
Entertainment or abuse? Running of the bulls in Pamplona Spain, on January 27, 2008. (CC Mike Brice).
Their company tours the country, offering these dangerous and cruel events as “sport.”
Last week, The New York Times quoted the Great Bull Run’s chief operating officer, Rob Dickens, as saying “we need to crank up the danger,” even though two people had just been injured in a recent Georgia bull run put on by his company—one with a pelvis broken in several places after being severely trampled by a bull. ...
To “crank up the danger,” some participants taunted, slapped, and otherwise egged on the bulls to make the experience more thrilling—and dangerous. “It is a truly dangerous event where runners could get seriously injured,” Dickens said to a Georgia reporter.
Why are the bulls running? These caged, frightened animals have often been used in rodeos, and are transported to the “event,” where they are clearly confused, unhappy, and irritated. I don’t see the sport in provoking innocent animals, just to get a thrill from their distress and their resulting panic. continue readin...
by Anita Wolff
by Kathleen Stachowski
Vet and Pet Industry Groups Betray Animals
by Stephen Wells
by Will Travers
Our thanks to Born Free USA for permission to republish this post, which originally appeared on the Born Free USA Blog on August 27, 2013. Travers is Chief Executive Officer of Born Free USA.
Adorable! Cuddly! Why are we so enamored by all things cute and furry—including inappropriate ones?
Monkeys, tigers, and now… sloths.
Juvenile three-toed sloth (Bradypus) climbing a tree branch.--© worldswildlifewonders/
An investigation undertaken by ABC’s “Nightline” found that sloths—even the endangered three-toed species of the animal—are one of the hottest items for sale in Colombia, next only to drugs and weapons. “Nightline” reports that an estimated 60,000 exotic animals were trafficked in the South American country last year a...
Despite the complexity of keeping sloths alive in captivity, their popularity is rising. Internet sites blithely tout how easy it is to own a sloth by claiming that they make cuddly, family-friendly pets. Sites like state that sloths are affectionate, playful, clean, quiet, and live a long life. Are you sure about that...
According to Zoologist Lucy Cooke, most zoos in the U.S. refuse to keep sloths because they require such specialized care. If zoos’[ experts find it difficult to keep a sloth alive, how can the untrained person keep one healthy as a pet? Cooke's quote says it all: "Sloths make lousy pets. Their highly specialized biolo...
Don't be fooled by the perpetual smile of the sloth. As with dolphins, a "smile" covers up the desperation they endure in captivity.
Keep wildlife in the wild---and that means sloths, too! If you want cute and cuddly, I'll bet your community has an animal shelter filled with adorable---and domestic---cats and dogs in need of loving homes. [Editor's note: And bunnies, too!]
• AC Spruce 688x190Banner
• CessnaPiperFlyer
• CessnaFlyer-Catalog
Rate this item
(0 votes)
FREDERICK, MD - The White House on Wednesday released a budget proposal that includes a $100 per-flight user fee -a charge the Aircraft Owners and Pilots Association (AOPA) warns could be disastrous for general aviation.
"We are disappointed to see this misguided idea resurfacing after it has been repeatedly and overwhelmingly rejected in the past. This is the wrong way to fund our aviation system," said AOPA President Craig Fuller. "Congress has said it will not tolerate user fees, and neither will the general aviation community."
Two previous budgets from the Obama Administration have included similar user fee proposals, but in each case Congress has rejected the idea. And opposition to user fees on Capitol Hill is growing. Last week, 223 bipartisan members of the House of Representatives signed a letter to the President, urging him to "abandon...
User fees appear to be just the latest salvo in a series of attacks on general aviation. The community is also contending with an FAA plan to close 149 contract air traffic control towers, selected primarily because they serve general aviation. Other challenges include attempts to change the way taxes are calculated fo...
"Taken together, these proposals represent a serious assault on general aviation, an industry that creates jobs, grows businesses, provides critical services, and donates tens of thousands of flight hours to charitable causes," Fuller said. "Either the Administration doesn't recognize the consequences of their actions,...