testing

Why is python slower compared to Ruby even with this very simple “test”?

拟墨画扇 提交于 2020-01-01 17:12:29
问题 See Is there something wrong with this python code, why does it run so slow compared to ruby? for my previous attempt at understanding the differences between python and ruby. As pointed out by igouy the reasoning I came up with for python being slower could be something else than due to recursive function calls (stack involved). I made this #!/usr/bin/python2.7 i = 0 a = 0 while i < 6553500: i += 1 if i != 6553500: a = i else: print "o" print a In ruby it is #!/usr/bin/ruby i = 0 a = 0 while

Optimal amount of testing for Selenium

孤街醉人 提交于 2020-01-01 17:03:53
问题 This question arises in the context of Selenium, but it's really about internal testing in "production quality" software in general. Basically, there are two things in Selenium that I am debating whether an internal test is needed and if so, how best to implement the test. (By internal test, I mean a test that is implemented within the script or library itself; not a dedicated unittest.) Navigating through webpages in Selenium should always (IMHO) have internal tests to make sure that the

In-container testing vs. mock objects for integration testing

五迷三道 提交于 2020-01-01 12:30:40
问题 In-container testing is often opposed to testing with mock objects. However, as mock objects simply mimic the behavior of the real objects, isn't the in-container testing the only way to really test the system in its' real environment? As an partial alternative to in-container testing and mock objects, Spring provides the TestContext framework that initializes Spring nicely without needing to start up the actual application container (web application server, in my case). However, this is

Run JMeter test case by a Java Stand-Alone Application, without having JMeter installed locally.

孤者浪人 提交于 2020-01-01 10:49:13
问题 I'm trying to execute the JMeter test case using the following command. Do I have another way of executing the test cases without having JMeter installed locally? Here I have to provide JMeter HOME path to JMeterUtils. // JMeter Engine StandardJMeterEngine jmeter = new StandardJMeterEngine(); // Initialize Properties, logging, locale, etc. JMeterUtils.loadJMeterProperties("/path/to/your/jmeter/bin/jmeter.properties"); JMeterUtils.setJMeterHome("/path/to/your/jmeter"); JMeterUtils.initLogging(

scala sbt test run setup and cleanup command once on multi project

那年仲夏 提交于 2020-01-01 10:16:30
问题 I know I can add setup and cleanup code in sbt for the test phase by modifying the testOptions, e.g.: val embedMongoTestSettings: Seq[Setting[_]] = Seq( testOptions in Test += Tests.Setup( () => createMongod()), testOptions in Test += Tests.Cleanup( () => destroyMongod()) ) The problem I have is that this done on a per project basis and then done once for every project. So when I have a multi project set up, I fire up several databases in this case (which would work, but means I have to

How to approach “end-client” performance testing on single-page (web) applications?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-01 08:56:19
问题 We are evaluating how to test performance on a single-page application (SPA) which relies heavily on JavaScript and dynamic content (updated via Ajax). Popular load-testing tools like Apache JMeter or Gatling are able to generate huge loads with little hardware by sending HTTP requests. But they do not process any Javascript code. We would like to measure performance as perceived by the client, that is, as perceived by end-user sitting in front of a browser (with all the rendering and

testing with specs, capybara from railstutorial chapter 3 does not work (have_selector('title', :text => ' | Home'))

三世轮回 提交于 2020-01-01 08:44:45
问题 im working on ruby.railstutorial.org/ruby-on-rails-tutorial-book. Im using rails 3.2.7, spork, rspec, capybara, launchy and some guards :) i have a really weird problem in Chapter 3 with testing: It seems like the tests arent working for what is inside the <head> -Tag. If i put the <title> -tag inside the <body> -tag instead of the head-tag it works fine. Also it works when i put <h1> -tags above the <title> inside <head> -Tags. It is weird, isnt it? Please help me figur out. The example is

Testing for asynchronous results without sleep in Go

佐手、 提交于 2020-01-01 08:43:12
问题 I have quite a few components in my code that have persistent go-routines that listen for events to trigger actions. Most of the time, there is no reason (outside of testing) for them to send back a notification when they have completed that action. However, my unittests are using sleep to wait for these async tasks to complete: // Send notification event. mock.devices <- []sparkapi.Device{deviceA, deviceFuncs, deviceRefresh} // Wait for go-routine to process event. time.Sleep(time

Testing for asynchronous results without sleep in Go

▼魔方 西西 提交于 2020-01-01 08:42:50
问题 I have quite a few components in my code that have persistent go-routines that listen for events to trigger actions. Most of the time, there is no reason (outside of testing) for them to send back a notification when they have completed that action. However, my unittests are using sleep to wait for these async tasks to complete: // Send notification event. mock.devices <- []sparkapi.Device{deviceA, deviceFuncs, deviceRefresh} // Wait for go-routine to process event. time.Sleep(time

Clicking 'OK' on alert or confirm dialog through jquery/javascript?

若如初见. 提交于 2020-01-01 08:35:07
问题 I was thinking of writing some UI tests in backbone.js and jquery. They may not be the best way to do it but it's something that I was thinking about - to automate the tests without record and playback - through plain code. The only thing that made me scratch my head using this approach is this: In some 'use-case flow' (of the execution) confirm/alert dialogs would show up. I'd like to click 'Ok' and continue the flow - is this even doable through plain javascript code? How? Note: I do know