|
I have a dev, that will get around our code coverage by writing tests that never fail.
The code is just atrocious, but the tests never catch it because they assert(true).
I code review, but I can't do everyones work for them, all the time. How do you ...
Started by DevelopingChris on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
Nester for no ....
You should have a look at doing some mutation testing , to detect weak tests.
You could always try a test to unit test.
It should be easy to detect assert(true) strings with simple grep -ping.
|
|
If you write a test class like
class MyTest < Test::Unit::TestCase def setup end def test_1 flunk end def test_1 assert true end end
the first test_1 is ignored. Although it looks like a stupid mistake, it can happen with copy and paste programming...
Started by Andrew Grimm on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
This is Ruby!, you can also do this directly in the class to create unique test methods:
class of some test method names from my most recent project:
test_should_not_do_html_escaping_for_administrators test_should_not....
|
|
I test my application with Cucumber and it worked before I've added auto-detection of locales from WWW browser in application_controller.rb:
before_filter :set_locale private def set_locale xxx = request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first...
Started by Voldy on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
You can add before statement in your.
Another way is "same-same, but different".
So to make this work add a step that puts stuff fits together .
Header can be set for the duration of the request.
|
Ask your Facebook Friends
|
I've got a Win32 C++ app with a suite of unit tests. After the unit tests have finished running, I'd like a human-readable report on any unfreed memory to be automatically generated. Ideally, the report will have a stack with files & line number info ...
Started by twk on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
If the numberIf you're using MSVC, Microsoft's Debug heap functions can be used to generate the report you want is destroyed (as well as adding sentinels....
Before and after each test (I think you can do it in setUp() and tearDown()).
|
|
Can a saliva test detect a little bit of marijuana used three weeks prior?
Started by mushki on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at yahoo):
Even a pee test should be clean.
No no saliva test is for recent smoking like within the last day.
|
|
Can a urine drug test detect gender?
Started by Tony on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at yahoo):
A drug test....
To the minimum line so that the lab can get a sufficient amount to accurately perform the lab test because most haven’t been actively involved in drug test procedures so it is not an unreasonable question to ask.
|
|
Is there a way to use PHP to detect if the page is being loaded using IE6?
Started by PHLAK on
, 9 posts
by 9 people.
Answer Snippets (Read the full thread at stackoverflow):
You can....
You can detect IE6 with HTML this way
<!--[if IE 6]> // ie6 only stuff here <![endif]-->: http://www.useragentstring.com/pages/Internet%20Explorer/ .)
You can use get_browser with updated browscap.ini file .
|
|
Hi,
I have placed an image (UIImageView) on the navigation bar. Now I want to detect the touch event and want to handle the event. Could you let me know how can I do that?
Thanks.
Started by ebaccount on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
A UIImageView is derived to indicate that the view can become the focus....
Within this method, test if any of the UITouch touches] ? Look into the function CGRectContainsPoint to run this test.
That contains your UIImageView subview.
|
|
I'm using PhoneGap 0.8 and I'd like to detect a basic shake gesture. I've found two relevant snippets:
http://groups.google.com/group/phonegap/browse_thread/thread/25178468b8eb9e9f
http://phonegap.pbworks.com/Handling-Shake-Events
Neither of them are ...
Started by GloryFish on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Your first link is using PhoneGap.Gesture , which as far as I can see doesn't exist (at least to be loaded to work properly before we can initialise so wait for it here */ (function() { var timer.
|
|
Well behaved windows programs need to allow users to save their work when they are shutting the PC down.
How can I make my app detect the shutdown event? Any solution should allow the user to abort the shutdown if user selects, say "Cancel".
The normal...
Started by Shaggy on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
You can get details for this from the MSDN documentation or by googling....
I guess the best possible method would be to detect weather your application is trying to close of the website)
Write some JNI code to WM_QUERYENDSESSION message.
|