Any one used Sonarqube to review loadrunner scripts? - jmeter

I would like to use Sonarqube to review LoadRunner/Jmeter scripts to check the code quality, are followed standards and best practice during test design.
any one used Sonarqube to do that before?

You could evaluate against coding standards pretty easily, such as inclusion of comments, standards for variable naming, etc... But who are you going to get to write the rules to determine if the script is valid, whether the items which are dynamic and need to be addressed, have been, whether you are checking for valid expected results?

Related

Testing a DSL / Grammar Written With Xtext

I've been set a task of writing a grammar / DSL with XText. It seems reasonably simple. I've been asked to incrementally add rules to the grammar as per a specification. I want to be able to test each new rule that I create.
I have Spring Tool Suite Version: 3.9.2.RELEASE, Build Id: 201712210947, Platform: Eclipse Oxygen.2 (4.7.2).
I've seen textboxes in web browsers that show syntax highlighting based on the validity of the input as per the grammar rules. Also, I'm aware that unit testing is a possibility.
What's the simplest way, minimal fuss, of verifying that the grammar works as expected?
Your help is greatly appreciated.
Thanks in advance,
Ryan
Writing a bunch of unit tests using ParseHelper and ValidationTestHelper should be the most sustainable way to do this.
e.g. https://github.com/eclipse/xtext-eclipse/blob/master/org.eclipse.xtext.xtext.ui.examples/projects/domainmodel/org.eclipse.xtext.example.domainmodel.tests/src/org/eclipse/xtext/example/domainmodel/tests/ValidationTests.xtend
The answer depends on what you mean by 'verifying that the grammar works as expected'. As Christian noted, unit tests using ParseHelper and ValidationTestHelper will tell you if your grammar is being parsed into the correct model and generating the appropriate errors otherwise. If however you want to test things like content assist, syntax higlighting and such, you have to go a little further and write some tests using AbstactEditorTest, AbstractOutlineTest, etc. in the ui.tests package for your Xtext project. After looking at a lot of tutorials I finally went ahead and bought Lorenzo Bettini's book:
Implementing Domain-Specific Languages with Xtext and Xtend - Second Edition
It was a great help in understanding Xtext, and how to test a grammar as you create it.

How see duplications from last analysis?

I'm trying to analyze the programmers profile. So I'm looking for people that is duplicating code, and trying to understand why they're doing this.
My idea is identify (if is lazy, lack of knowledge, etc) and attack the problem in root.
Is there anyway to see only the duplications added ONLY in last analysis of SonarQube?
Just checked on nemo and the time machine view just tells you how much code duplication was added since last analysis, but doesn't actually link to the new issues unlike other metrics. Most likely it's not supported yet..

Current state of BeanShell

We are investigating possibility of using BeanShell to write scripts that do a lot of file operations.
Currently bash scripts are used.
Now the main question is - is BeanShell stable at this moment?
I know that it is not actively supported , but does that matter? Are there bugs?
What about BeanShell2? Is it original plus some bug-fixes? Or are there other changes?
I am also wondering if at this point in time using Groovy is better given that it is actively supported and developed by Pivotal.
Any additional information regarding pros and cons of either Bash scripts, BeanShell and Groovy scripts is greatly appreciated.
You really haven't given us much to go on here. No specifics about your environment, not much in the way of criteria. Nothing really about the problems that you are trying to solve with scripting. You are clearly thinking about moving away from bash for some reason, but you haven't really told us why.
If you are comfortable with bash, then I agree with #Nick Ellis. Stick with it.
However, if for some reason you are determined to choose either Groovy or Beanshell, the choice is pretty clear. Groovy is a well-supported language whose user base and application base are both growing by leaps and bounds. Beanshell... not so much.
I searched around to understand the current situation a few months ago and here are my findings.
Original release from http://www.beanshell.org hasn't been updated since 2.0b4
In maven repository, last release from benshell.org is 2.0b5 on Jun, 2005.
In 2011, beanshell2 was forked. Last release was v2.1.8 on Feb 20,2014. This fork is never released to maven repo.
In 2012, there was a discussion on apache commons-dev to adopt beanshell.
In 2013, it was reminded that it was not voted on incubator list.
Shortly after, it was proposed and voted on incubator-general.
But then, it was followed by a discussion that it should be put into sandbox.
In 2015, beanshell2 was cloned to github from google code.
Also on 2015-09-23, apache-extras repository was moved from google code to https://github.com/beanshell/beanshell/. (I missed the creation of original repository)
I would stick with bash. Even if one of these scripting languages is better in the sense that it has features you want, is easier to use, or has more support, you still need to switch from bash to this other language. Furthermore bash is drastically more common and well known, which means it is easier to find people who know it and find solutions on line. Without a very strong reason, such as a feature you need that bash doesn't provide, it seems like making the switch would be a lot of trouble without gaining much ground.
Adding to #hsib answer, There's a new 2.0b6 version:
2016-02-18 Security update
Note: A security vulnerability has been identified in BeanShell that could be exploited for remote code execution in applications that has BeanShell on its classpath (CVE-2016-2510). The vulnerability has been fixed in the security update BeanShell 2.0b6.

What's the difference between sublimelinter-php and sublimelinter-phpcs?

From what I know, CodeSniffer follows a certain set of coding standards and checks your code if it follows the said standards. But sublimelinter-php does this too. Are they different or are they just the same? Because I installed both plugins on my Sublime Text 3.
SublimeLinter-phpcs allows you to run PHP_CodeSniffer over your code, ensuring it conforms to whatever coding standard you use.
SublimeLinter-php allows you tun run php -l over your code, ensuring that it does not contain any syntax errors. It does not seem to check any coding standards.
PHP_CodeSniffer does not actually check code for syntax errors, so having both installed is probably a good idea. Use SublimeLinter-php to make sure your code is going to run, and SublimeLinter-phpcs to make sure your coding standards are being followed.

Hudson/Jenkins source code metrics?

Are there any useful plugins for source code metrics for Hudson/Jenkins?
I'm looking for total lines of code, total number of tests, classes, etc. with graphing.
Does anything like this exist?
Are you using Java? If so, SONAR should certainly be your first port of call. It does a lot on it's own and also wraps up all the major Java analysis tools, such as:
Out of the box, you'll get metrics on:
Potential Architectural & Design issues
Unit test coverage (uses cobertura)
Lines of code\packages\classes etc
Potential bugs
Code duplication
Adherence to code formatting standards
(plus many more)
It allows you to traverse from the high level analysis through to the source code it relates to. It will be easier if you're using Maven for your build though...
There is a Hudson plugin. And it's free.
Try CCCC (http://sourceforge.net/projects/cccc/). It does code counting, module counting (classes), etc., and the plugin also graphs it for you. (for C, C++)
Incidently, what language are you looking at?
There's also CLOC (Count lines of Code) which will tell you how many lines of each language you have, although I can't seem to find a link for it.
You don't specify which language you are using, but Redsolo's awesome blog post Guide to building .NET projects using Hudson shows you how to use FxCop and NUnit on Hudson to give some of what you are looking for. The Violations plugin used also supports Simian, CPD, PMD and PyLint.

Resources