software-quality

How to simulate 120 concurrent users of a web application with real conditions?

冷暖自知 提交于 2019-12-05 06:58:51
How to you simulate > 120 concurrent users using a Load Test Framework such as JMeter? Real concurrency, as far as I understand, would be possible if I would use 120 servers or 120 CPU cores. How did/do you test your web application or service with real conditions? I have found JMeter to work fine, but I generally use is across 4-5 PC's to get the most accurate results. Although you may believe 120 concurrent users may be difficult to simulate from a single PC, you have to realise that in a real work scenario, 120 simultaneous users will not be accessing the server at exactly the same time,

FindBugs - “may fail to close stream” when using ObjectOutputStream

こ雲淡風輕ζ 提交于 2019-12-04 03:12:14
I have this piece of code, which is to write an Ojbect to a byte array stream: static byte[] toBytes(MyTokens tokens) throws IOException { ByteArrayOutputStream out = null; ObjectOutput s = null; try { out = new ByteArrayOutputStream(); try { s = new ObjectOutputStream(out); s.writeObject(tokens); } finally { try { s.close(); } catch (Exception e) { throw new CSBRuntimeException(e); } } } catch (Exception e) { throw new CSBRuntimeException(e); } finally { IOUtils.closeQuietly(out); } return out.toByteArray(); } However, FindBugs keeps complaining about line: s = new ObjectOutputStream(out);

Is it possible exclude test directories from coverage.py reports?

和自甴很熟 提交于 2019-12-03 11:27:26
问题 I'm kind of a rookie with python unit testing, and particularly coverage.py. Is it desirable to have coverage reports include the coverage of your actual test files? Here's a screenshot of my HTML report as an example. You can see that the report includes tests/test_credit_card . At first I was trying to omit the tests/ directory from the reports, like so: coverage html --omit=tests/ -d tests/coverage I tried several variations of that command but I could not for the life of me get the tests/

coverage.py: exclude files

余生长醉 提交于 2019-12-03 08:09:14
问题 How do I exclude entire files from coverage.py reports? According to the documentation you can exclude code by matching lines. I want to exclude entire files, so that the reports don't include 3rd party libraries. Am I missing something? Can it be done? 回答1: You can omit modules with the --omit flag. It takes a comma-separated list of path prefixes. So for example: coverage run my_program.py coverage report --omit=path/to/3rdparty 回答2: Omitting some files worked for me using coverage API.

What do you do with a developer who does not test his code? [closed]

给你一囗甜甜゛ 提交于 2019-12-03 04:52:43
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . One of our developers is continually writing code and putting it into version control without testing it. The quality of our code is suffering as a result. Besides getting rid of the developer, how can I solve this problem? EDIT I have talked to him about it number of times and even given him written warning 回答1

How would you measure code “quality” across a large project

浪尽此生 提交于 2019-12-03 01:13:31
I'm working on a quite large project, a few years in the making, at a pretty large company, and I'm taking on the task of driving toward better overall code quality. I was wondering what kind of metrics you would use to measure quality and complexity in this context. I'm not looking for absolute measures, but a series of items which could be improved over time. Given that this is a bit of a macro-operation across hundreds of projects (I've seen some questions asked about much smaller projects), I'm looking for something more automatable and holistic. So far, I have a list that looks like this:

Is it possible exclude test directories from coverage.py reports?

走远了吗. 提交于 2019-12-03 00:56:18
I'm kind of a rookie with python unit testing, and particularly coverage.py. Is it desirable to have coverage reports include the coverage of your actual test files? Here's a screenshot of my HTML report as an example. You can see that the report includes tests/test_credit_card . At first I was trying to omit the tests/ directory from the reports, like so: coverage html --omit=tests/ -d tests/coverage I tried several variations of that command but I could not for the life of me get the tests/ excluded. After accepting defeat, I began to wonder if maybe the test files are supposed to be

coverage.py: exclude files

蹲街弑〆低调 提交于 2019-12-02 21:48:54
How do I exclude entire files from coverage.py reports? According to the documentation you can exclude code by matching lines. I want to exclude entire files, so that the reports don't include 3rd party libraries. Am I missing something? Can it be done? You can omit modules with the --omit flag. It takes a comma-separated list of path prefixes. So for example: coverage run my_program.py coverage report --omit=path/to/3rdparty Omitting some files worked for me using coverage API. Well it is the same kind what Ned suggested. Here it is how I did it: cov = coverage.coverage(omit='/usr/lib/python2

What do you do with a developer who does not test his code? [closed]

帅比萌擦擦* 提交于 2019-12-02 19:14:23
One of our developers is continually writing code and putting it into version control without testing it. The quality of our code is suffering as a result. Besides getting rid of the developer, how can I solve this problem? EDIT I have talked to him about it number of times and even given him written warning Martin Pilot If you systematically perform code reviews before allowing a developer to commit the code, well, your problem is mostly solved. But this doesn't seem to be your case, so this is what I recommend: Talk to the developer. Discuss the consequences for others in the team. Most

How to bring coordination between file system and database?

别来无恙 提交于 2019-11-30 13:41:57
I am working on a online file management project. We are storing references on the database (sql server) and files data on the on file system. We are facing a problem of coordination between file system and database while we are uploading a file and also in case of deleting a file. First we create a reference in the database or store files on file system. The problem is that if I create a reference in the database first and then store a file on file system, but while storing files on the file system any type of error occur, then the reference for that file is created in the database but no