azizkhani.net

I know that I know nothing

کلاه قرمزی

clock September 14, 2012 21:33 by author Administrator



links

clock September 12, 2012 14:05 by author Administrator

Common sense and Code Quality

Resource Bundle Tricks and Best Practices

Common sense and Code Quality

 

Computer Programming Is Still an Art 

Understanding and Explaining “Iterative Development”

 



captcha

clock September 11, 2012 21:22 by author Administrator

 C ompletely A utomated P ublic T est to tell C omputers and H umans A part



JAVA INTERVIEW QUESTIONS PAGE :D

clock September 3, 2012 22:35 by author Administrator

1. What is the difference between private, protected, and public?

These keywords are for allowing privileges to components such as java methods and variables.
Public: accessible to all classes
Private: accessible only to the class to which they belong
Protected: accessible to the class to which they belong and any subclasses.
Access specifiers are keywords that determines the type of access to the member of a class. These are:
* Public
* Protected
* Private
* Defaults

2. What's the difference between an interface and an abstract class? Also discuss the similarities. (Very Important)

Abstract class is a class which contain one or more abstract methods, which has to be implemented by sub classes. Interface is a Java Object containing method declaration and doesn't contain implementation. The classes which have implementing the Interfaces must provide the method definition for all the methods
Abstract class is a Class prefix with a abstract keyword followed by Class definition. Interface is a Interface which starts with interface keyword.
Abstract class contains one or more abstract methods. where as Interface contains all abstract methods and final declarations
Abstract classes are useful in a situation that Some general methods should be implemented and specialization behavior should be implemented by child classes. Interfaces are useful in a situation that all properties should be implemented.

Differences are as follows:

* Interfaces provide a form of multiple inheritance. A class can extend only one other class.
* Interfaces are limited to public methods and constants with no implementation. Abstract classes can have a partial implementation, protected parts, static methods, etc.
* A Class may implement several interfaces. But in case of abstract class, a class may extend only one abstract class.
* Interfaces are slow as it requires extra indirection to to find corresponding method in in the actual class. Abstract classes are fast. 

Similarities:

* Neither Abstract classes or Interface can be instantiated.

How to define an Abstract class?
A class containing abstract method is called Abstract class. An Abstract class can't be instantiated.
Example of Abstract class:

abstract class testAbstractClass { 
    protected String myString; 
    public String getMyString() { 
    return myString; 

public abstract string anyAbstractFunction();
}

How to define an Interface?
Answer: In Java Interface defines the methods but does not implement them. Interface can include constants. A class that implements the interfaces is bound to implement all the methods defined in Interface.
Example of Interface:

public interface sampleInterface {
    public void functionOne();
    public long CONSTANT_ONE = 1000;
}

3. Question: How you can force the garbage collection?

Garbage collection automatic process and can't be forced. You could request it by calling System.gc(). JVM does not guarantee that GC will be started immediately.

Garbage collection is one of the most important feature of Java, Garbage collection is also called automatic memory management as JVM automatically removes the unused variables/objects (value is null) from the memory. User program can't directly free the object from memory, instead it is the job of the garbage collector to automatically free the objects that are no longer referenced by a program. Every class inherits finalize() method from java.lang.Object, the finalize() method is called by garbage collector when it determines no more references to the object exists. In Java, it is good idea to explicitly assign null into a variable when no more in use. I Java on calling System.gc() and Runtime.gc(), JVM tries to recycle the unused objects, but there is no guarantee when all the objects will garbage collected.

4. What's the difference between constructors and normal methods?

Constructors must have the same name as the class and can not return a value. They are only called once while regular methods could be called many times and it can return a value or can be void.

5. Can you call one constructor from another if a class has multiple constructors

Yes. Use this() to call a constructor from an other constructor.

6. Explain the usage of Java packages.

This is a way to organize files when a project consists of multiple modules. It also helps resolve naming conflicts when different packages have classes with the same names. Packages access level also allows you to protect data from being used by the non-authorized classes.

7. Explain in your own words the "bottom line" benefits of the use of an interface.

The interface makes it possible for a method in one class to invoke methods on objects of other classes, without the requirement to know the true class of those objects, provided that those objects are all instantiated from classes that implement one or more specified interfaces. In other words, objects of classes that implement specified interfaces can be passed into methods of other objects as the generic type Object, and the methods of the other objects can invoke methods on the incoming objects by first casting them as the interface type.

8. What are some advantages and disadvantages of Java Sockets?

Some advantages of Java Sockets: 
Sockets are flexible and sufficient. Efficient socket based programming can be easily implemented for general communications. Sockets cause low network traffic. Unlike HTML forms and CGI scripts that generate and transfer whole web pages for each new request, Java applets can send only necessary updated information.

Some disadvantages of Java Sockets:
Security restrictions are sometimes overbearing because a Java applet running in a Web browser is only able to establish connections to the machine where it came from, and to nowhere else on the network   Despite all of the useful and helpful Java features, Socket based communications allows only to send packets of raw data between applications. Both the client-side and server-side have to provide mechanisms to make the data useful in any way.

9. Explain the usage of the keyword transient?

Transient keyword indicates that the value of this member variable does not have to be serialized with the object. When the class will be de-serialized, this variable will be initialized with a default value of its data type (i.e. zero for integers).

10. What's the difference between the methods sleep() and wait()

The code sleep(1000); puts thread aside for exactly one second. The code wait(1000), causes a wait of up to one second. A thread could stop waiting earlier if it receives the notify() or notifyAll() call. The method wait() is defined in the class Object and the method sleep() is defined in the class Thread.

11. What would you use to compare two String variables - the operator == or the method equals()?

I'd use the method equals() to compare the values of the Strings and the == to check if two variables point at the same instance of a String object.

12. Why would you use a synchronized block vs. synchronized method?

Synchronized blocks place locks for shorter periods than synchronized methods.

13. What access level do you need to specify in the class declaration to ensure that only classes from the same directory can access it?

You do not need to specify any access level, and Java will use a default package access level.

14. Can an inner class declared inside of a method access local variables of this method?

It's possible if these variables are final.

15. What can go wrong if you replace && with & in the following code:
String a=null; if (a!=null && a.length()>10) {...}

A single ampersand here would lead to a NullPointerException.

16. What's the main difference between a Vector and an ArrayList?

Java Vector class is internally synchronized and ArrayList is not synchronized.

17. Describe the wrapper classes in Java.

Wrapper class is wrapper around a primitive data type. An instance of a wrapper class contains, or wraps, a primitive value of the corresponding type.

Following table lists the primitive types and the corresponding wrapper classes:
Primitive Wrapper
boolean  - java.lang.Boolean
byte - java.lang.Byte
char - java.lang.Character
double - java.lang.Double
float - java.lang.Float
int - java.lang.Integer
long - java.lang.Long
short - java.lang.Short
void - java.lang.Void

18. How could Java classes direct program messages to the system console, but error messages, say to a file?

The class System has a variable out that represents the standard output, and the variable err that represents the standard error device. By default, they both point at the system console. This how the standard output could be re-directed:
Stream st = new Stream(new FileOutputStream("output.txt")); System.setErr(st); System.setOut(st);

19. How do you know if an explicit object casting is needed?

If you assign a superclass object to a variable of a subclass's data type, you need to do explicit casting. For example:
Object a; Customer b; b = (Customer) a;

20. When you assign a subclass to a variable having a supeclass type, the casting is performed automatically. Can you write a Java class that could be used both as an applet as well as an application?

Yes. Add a main() method to the applet.

21. If a class is located in a package, what do you need to change in the OS environment to be able to use it?

You need to add a directory or a jar file that contains the package directories to the CLASSPATH environment variable. Let's say a class Employee belongs to a package com.xyz.hr; and is located in the file c:\dev\com\xyz\hr\Employee.javIn this case, you'd need to add c:\dev to the variable CLASSPATH. If this class contains the method main(), you could test it from a command prompt window as follows:
c:\>java com.xyz.hr.Employee

22. What's the difference between J2SDK 1.5 and J2SDK 5.0?

There's no difference, Sun Microsystems just re-branded this version.

23. Does it matter in what order catch statements for FileNotFoundException and IOExceptipon are written?

Yes, it does. The FileNoFoundException is inherited from the IOException. Exception's subclasses have to be caught first.

24. Name the containers which uses Border Layout as their default layout?

Containers which uses Border Layout as their default are: window, Frame and Dialog classes.

25. You are planning to do an indexed search in a list of objects. Which of the two Java collections should you use:
ArrayList or LinkedList?

ArrayList

26. When should the method invokeLater()be used?

This method is used to ensure that Swing components are updated through the event-dispatching thread.

27. How can a subclass call a method or a constructor defined in a superclass?

Use the following syntax: super.myMethod(); To call a constructor of the superclass, just write super(); in the first line of the subclass's constructor.

28. What do you understand by Synchronization?

Synchronization is a process of controlling the access of shared resources by the multiple threads in such a manner that only one thread can access one resource at a time. In non synchronized multithreaded application, it is possible for one thread to modify a shared object while another thread is in the process of using or updating the object's value. Synchronization prevents such type of data corruption.
E.g. Synchronizing a function:
public synchronized void Method1 () {
    // Appropriate method-related code. 
}
E.g. Synchronizing a block of code inside a function:
public myFunction (){
    synchronized (this) { 
    // Synchronized code here.
  }
}

29. What's the difference between a queue and a stack?

Stacks works by last-in-first-out rule (LIFO), while queues use the FIFO rule

30. You can create an abstract class that contains only abstract methods. On the other hand, you can create an interface that declares the same methods. So can you use abstract classes instead of interfaces?

Sometimes. But your class may be a descendent of another class and in this case the interface is your only option.

31. If you're overriding the method equals() of an object, which other method you might also consider?

hashCode()

32. What is Collection API?

The Collection API is a set of classes and interfaces that support operation on collections of objects. These classes and interfaces are more flexible, more powerful, and more regular than the vectors, arrays, and hashtables if effectively replaces. 
Example of classes: HashSet, HashMap, ArrayList, LinkedList, TreeSet and TreeMap.
Example of interfaces: Collection, Set, List and Map.

33. How would you make a copy of an entire Java object with its state?

Have this class implement Cloneable interface and call its method clone().

34. How can you minimize the need of garbage collection and make the memory use more effective?

Use object pooling and weak object references.

35. There are two classes: A and B. The class B need to inform a class A when some important event has happened. What Java technique would you use to implement it?

If these classes are threads I'd consider notify() or notifyAll(). For regular classes you can use the Observer interface.

36. Explain the Encapsulation principle.

Encapsulation is a process of binding or wrapping the data and the codes that operates on the data into a single entity. This keeps the data safe from outside interface and misuse. One way to think about encapsulation is as a protective wrapper that prevents code and data from being arbitrarily accessed by other code defined outside the wrapper. 

37. Explain the Inheritance principle.

Inheritance is the process by which one object acquires the properties of another object. 

38. Explain the Polymorphism principle.

The meaning of Polymorphism is something like one name many forms. Polymorphism enables one entity to be used as as general category for different types of actions. The specific action is determined by the exact nature of the situation. The concept of polymorphism can be explained as "one interface, multiple methods". 
From a practical programming viewpoint, polymorphism exists in three distinct forms in Java:

* Method overloading
* Method overriding through inheritance
* Method overriding through the Java interface

39. Is Iterator a Class or Interface? What is its use?

Iterator is an interface which is used to step through the elements of a Collection. 

40. Explain the user defined Exceptions?

User defined Exceptions are the separate Exception classes defined by the user for specific purposed. An user defined can created by simply sub-classing it to the Exception class. This allows custom exceptions to be generated (using throw) and caught in the same way as normal exceptions.
Example:

class myCustomException extends Exception {
     / The class simply has to exist to be an exception
}


41. What is OOPS?

OOP is the common abbreviation for Object-Oriented Programming
There are three main principals of oops which are called Polymorphism, Inheritance and Encapsulation. 

39.  Read the following program:

public class test {
public static void main(String [] args) {
    int x = 3;
    int y = 1;
    if (x = y)
        System.out.println("Not equal");
   else
        System.out.println("Equal");
  }
}

What is the result?
The output is “Equal”
B. The output in “Not Equal”
C. An error at " if (x = y)" causes compilation to fall.
D. The program executes but no output is show on console.
Answer: C
Answer: Transient variable can't be serialize. For example if a variable is declared as transient in a Serializable class and the class is written to an ObjectStream, the value of the variable can't be written to the stream instead when the class is retrieved from the ObjectStream the value of the variable becomes null.

# Question: Name the containers which uses Border Layout as their default layout?
Answer: Containers which uses Border Layout as their default are: window, Frame and Dialog classes.

# Question: What do you understand by Synchronization?
Answer: Synchronization is a process of controlling the access of shared resources by the multiple threads in such a manner that only one thread can access one resource at a time. In non synchronized multithreaded application, it is possible for one thread to modify a shared object while another thread is in the process of using or updating the object's value. Synchronization prevents such type of data corruption.
E.g. Synchronizing a function:
public synchronized void Method1 () {
// Appropriate method-related code.
}
E.g. Synchronizing a block of code inside a function:
public myFunction (){
synchronized (this) {
// Synchronized code here.
}
}



JOB INTERVIEW QUESTIONNAIRE

clock September 3, 2012 22:30 by author Administrator

General Questions:

  • Are you on Twitter?
    • If so, who do you follow on Twitter?
  • Are you on Github?
    • If so, what are some examples of repos you follow
  • What blogs do you follow?
  • What version control systems have you used?
  • What is your preferred development enviroment? (OS, Editor, Browsers, Tools etc.)
  • Can you describe your workflow when you create a web page?
  • Can you describe the difference between progressive enhancement and graceful degradation?
    • Bonus points for the answer “no one can”
    • Extra bonus points for describing feature detection
  • Explain what “Semantic HTML” means.
  • What does “minification” do?
  • Why is it better to serve site assets from multiple domains? 
    • How many resources will a browser download from a given domain at a time?
  • If you have 8 different stylesheets for a given design, how would you integrate them into the site?
    • Looking for file concatenation.
    • Points off for @import, unless it works in conjunction with a build system.
  • If you jumped on a project and they used tabs and you used spaces, what would you do?
    • issue :retab! command
  • Write a simple slideshow page
    • Bonus points if it does not use JS.
  • What tools do you use to test your code’s performance?
  • If you could master one technology this year, what would it be?
  • Name 3 ways to decrease page load. (perceived or actual load time)
  • Explain the importance of standards.

HTML-Specific Questions:

  • What’s a doctype do, and how many can you name?
  • What’s the difference between standards mode and quirks mode?
  • What are the limitations when serving XHTML pages?
    • Are there any problems with serving pages as application/xhtml+xml?
  • How do you serve a page with content in multiple languages?
  • Can you use XHTML syntax in HTML5? How do you use XML in HTML5?
  • What are data- attributes good for?
  • What are the content models in HTML4 and are they different in HTML5?
  • Consider HTML5 as an open web platform. What are the building blocks of HTML5?
  • Describe the difference between cookies, sessionStorage and localStorage.

JS-Specific Questions

  • Which JavaScript libraries have you used?
  • How is JavaScript different from Java?
  • What are undefined and undeclared variables?
  • What is a closure, and how/why would you use one?
    • Your favorite pattern used to create them? argyle (Only applicable to IIFEs)
  • What’s a typical use case for anonymous functions?
  • Explain the “JavaScript module pattern” and when you’d use it.
    • Bonus points for mentioning clean namespacing.
    • What if your modules are namespace-less?
  • how do you organize your code? (module pattern, classical inheritance?)
  • What’s the difference between host objects and native objects?
  • Difference between:
    function Person(){}
    var person = Person()
    var person = new Person()
  • What’s the difference between .call and .apply?
  • explain Function.prototype.bind?
  • When do you optimize your code?
  • Can you explain how inheritance works in JavaScript?
    • Bonus points for the funny answer: “no one can”
    • Extra bonus points if they take a stab at explaining it
  • When would you use document.write()?
    • Correct answer: 1999 – time to weed out the junior devs
  • What’s the difference between feature detection, feature inference, and using the UA string
  • Explain AJAX in as much detail as possible
  • Explain how JSONP works (and how it’s not really AJAX)
  • Have you ever used JavaScript templating, and if so, what/how?
  • Explain “hoisting”.
  • What is FOUC? How do you avoid FOUC?
  • Describe event bubbling.
  • What’s the difference between an “attribute” and a “property”?
  • Why is extending built in JavaScript objects not a good idea?
  • Why is extending built ins a good idea?
  • Difference between document load event and document ready event?
  • What is the difference between == and ===?
  • Explain how you would get a query string parameter from the browser window’s URL.
  • Explain the same-origin policy with regards to JavaScript.
  • Explain event delegation.
  • Describe inheritance patterns in JavaScript.
  • Make this work: 
    [1,2,3,4,5].duplicator(); // [1,2,3,4,5,1,2,3,4,5]
  • Describe a strategy for memoization in JavaScript.
  • Why is it called a Ternary statement, what does the word “Ternary” indicate?
  • What is the arity of a function?

JS-Code Examples:

~~3.14

Question: What value is returned from the above statement?
Answer: 3

"i'm a lasagna hog".split("").reverse().join("");

Question: What value is returned from the above statement?
Answer: “goh angasal a m’i”

( window.foo || ( window.foo = "bar" ) );

Question: What is the value of window.foo?
Answer: “bar”

var foo = "Hello";
(function() { 
  var bar = " World"
  alert(foo + bar); 
})(); 
alert(foo + bar);

Question: What is the outcome of the two alerts above?
Answer: ”Hello World” & ReferenceError: bar is not defined

jQuery-Specific Questions:

  • Explain “chaining”.
  • What does .end() do?
  • How, and why, would you namespace a bound event handler?
  • What is the effects (or fx) queue?
  • What is the difference between .get(), [], and .eq()?
  • What is the difference between .bind(), .live(), and .delegate()?
  • What is the difference between $ and $.fn? Or just what is $.fn.
  • Optimize this selector:
    $(".foo div#bar:eq(0)")

CSS-Specific Questions:

  • Describe what a “reset” CSS file does and how it’s useful.
  • Describe Floats and how they work.
  • What are the various clearing techniques and which is appropriate for what context?
  • Explain CSS sprites, and how you would implement them on a page or site.
  • What are the differences between the IE box model and the W3C box model?
  • What are your favourite image replacement techniques and which do you use when?
  • CSS property hacks, conditionally included .css files, or… something else?
  • How do you serve your pages for feature-constrained browsers?
    • What techniques/processes do you use?
  • What are the different ways to visually hide content (and make it available only for screenreaders)?
  • Have you ever used a grid system, and if so, what do you prefer?
  • Hav you used or implement media queries or mobile specific layouts/CSS? 
  • Any familiarity with styling SVG?
  • How do you optimize your webpages for print?
  • What are some of the “gotchas” for writing efficient CSS?
  • Do you use LESS?
  • How would you implement a web design comp that uses non-standard fonts? (avoid mentioning webfonts so they can figure it out)
  • Explain how a browser determines what elements match a CSS selector?

Optional fun Questions:

  • What’s the coolest thing you’ve ever coded, what are you most proud of?
  • Do you know the HTML5 gang sign?
  • Are you now, or have you ever been, on a boat.
  • Tell me your favorite parts about Firebug / Webkit Inspector.
  • Do you have any pet projects? What kind?
  • Explain the significance of “cornify”.
  • On a piece of paper, write down the letters A B C D E vertically. Now put these in descending order without writing one line of code.
    • Wait and see if they turn the paper upside down
    • This should make the laugh and is a fine way to relieve some tension at the end of the interview.
  • Pirate or Ninja?
    • bonus if it’s a combo and a good reason was given (+2 for zombie monkey pirate ninjas)
    • If not Web Development what would you be doing?
    • Where in the world is Carmen Sandiego?
      • (hint: their answer is always wrong)
    • What’s your favorite feature of Internet Explorer?


20 +2 Subjects Every Software Engineer Should Know … and the books you need

clock September 3, 2012 22:07 by author Administrator

I recently read an extremely interesting and useful article about the 20 subjects that every software engineer should know or learn….
What is really cool is that it’s not restricted to products, languages but it describes generally accpepted technologies, methodologies and practices.
It applies both to  junior and exeperienced software engineers. The former have a guideline about the fields that need to focus whereas the latter have the chance to re-evaluate their knowledge.
What’s missing, IMHO, is to give the reader a clue about which are the best book(s) related to these subjects so in this post I give my advices on that. Of course the list of books is not complete and it’s just my opinion based on my experience.

Hope you find it useful as well!

1. Object oriented analysis & design

2. Software quality factors

3. Data structures & algorithms: Basic data structures like array, list, stack, tree, map, set etc. and useful algorithms are vital for software development. Their logical structure should be known.
 
6. Software processes and metrics
8. Operating systems basics
10. Network basics
 
13. Dependency management
15. ORM (Object relational mapping)
 
18. Internationalization (i18n)
 
19. Architectural patterns
20. Writing clean code

21. Web Services

22. XML 



open source platform measuring software quality

clock September 3, 2012 22:00 by author Administrator

Sonar (by SonarSource.com) is getting more and more popular among developer teams. It’s an open source platform measuring software quality in the following 7 axes

  1. Architecture and Design 
  2. Comments 
  3. Coding Rules 
  4. Complexity 
  5. Code Duplication 
  6. Potential Bugs 
  7. Unit Tests 

If you’re a Sonar newbie then you might find this blog post very useful. On the other hand if you’re an experienced user then you can refresh your memory and what you’ve learned so far. Sonar’s Alphabet is not a user manual. It’s a reference to help you learn (and teach others) some basic terms and words used in the world of Sonar.

  • A for Analysis : Sonar’s basic feature is the ability to analyse source with various ways (Maven, Ant, Sonar runner, trigger by CI system ) . You can have static and/or dynamic analysis if supported by the analyzed language. 
  • B for Blockers : These are violations of the highest severity. They are considered real (not potential bugs ) so fix them as soon as possible 
  • C for Continuous Inspection : Continuous Inspection requires a tool to automate data collection, to report on measures and to highlight hot spots and defects and yes, Sonar is currently the leading “all-in-one” Continuous Inspection engine. 
  • D for Differential Views : Sonar’s star feature let you compare a snapshot analysis with a previous analysis. Fully customizable and dynamic makes continuous inspection a piece of cake. 
  • E for Eclipse. If you’re an Eclipse fan then did you know that you can have most of Sonar’s features in your IDE without leaving it. If not then you should give a try the Sonar’s Eclipse plugin. 
  • F for Filters : Filters are used to specify conditions and criteria on which projects are displayed. They can be used in dashboards or in widgets that require a filter. 
  • G for Global Dashboards : Global dashboards are available at instance level and can be accessed through the menu on the left. One of those global dashboards is set as your home page.Any widget can be added to a global dashboard. Thus, any kinds of information from a project or from the Sonar instance can be displayed at will. 
  • H for Historical Information : Knowing the quality level of your source code in a specific time instance is not enough. You need to be able to compare it with previous analysis. Sonar keeps historical information that can be viewed with many ways such as Timeline widget, Historical table widget or metric tendencies. 
  •  I for Internationalization : Sonar (and some of the open source plugins) supports internationalization. It’s available in 7 languages. 
  • J for Jenkins : Although jenkins is not a term of Sonar, you’ll read it in many posts and articles. A best practice to run Sonar analysis and to achieve Continuous Inspection is to automate it by using a CI server. Sonar folks have created a very simple, still useful plugin, that integrates Sonar with Jenkins 
  • K for Key : If you want to dive in Sonar’s technical details or write your own plugin then don’t forget that most of core concepts are identified by a key ( project key, metric key, coding rule key etc. ) 
  • L for Languages : Sonar was initially designed to analyze Java source code. Today, more than 20 languages are supported by free or commercial plugins. 
  • M for Manual Measures : You can even define your own measures and set their values when automated calculation is not feasible ( such as team size, project budget etc. ) 
  • N for Notifications : Let Sonar sends you an email when Changes in review assigned to you or created by you New violations on your favorite projects introduced during the first differential view period. 
  • O for Opensource : Sonar core as well as most of the plugins are available in CodeHaus or GitHub. 
  • P for plugins. More than 50 Sonar plugins are available for a variety of topics. New languages, reporting, integration with other systems and many more. The best way to Install / update them through the Update Center. 
  • Q for Quality Profiles. Sonar comes with default Quality profiles. For each language you can create your own profiles or edit the existing ones to adjust sonar analysis according to your demands. For each quality profile you activate/deactivate rules from the most popular tools such as PMD, FindBugs, Checkstyle and of course rules directly created by Sonar guys. 
  • R for Reviews : Code Reviews made easy with Sonar. You can assign reviews directly to Sonar users and associate them with a violation. Create action plans to group them and track their progress from analysis to analysis. 
  • S for Sonar in Action book. The only Sonar book that covers all aspects of Sonar. For beginners to advanced users even for developers that want to write their own plugins. 
  • T for Testing : Sonar provides many test metrics such as line coverage, branch coverage and code coverage. It’s integrated with most popular coverage tools (jacoco, emma, cobertura, clover). It can show also metrics on integration tests and by installing opensource plugins you can integrate it with other test frameworks ( JMeter, Thucycides, GreenPepper etc.) 
  • U for User mailing list. Being an active member of this list I can assure you that you can get answers for all your issues and problems. 
  • V for Violations : A very popular term in Sonar. When a source code file (tests files apply also) doesn't comply with a coding rule then Sonar creates a violation about it. 
  • W for Widgets : Everything you see in a dashboard is a widget. Some of them are only available only for global dashboards. You can add as many as you want in a dashboard and customize them to fit your needs. There are many Sonar core widgets and usually plugins may offer some additional widgets. 
  • X for X-ray : You can consider Sonar as your x-rays glasses to actually see IN your code. Nothing is hidden anymore and everything is measured. 
  • Y for Yesterday’s comparison : One of the most common differential views usages is to compare the current analysis snapshot with the analysis triggered yesterday. Very useful if you don’t want to add up your technical debt and handle it only at the end of each development cycle. 
  • Z for Zero values : For many Sonar metrics such as code duplication, critical/blocker violations, package cycles your purpose should be to minimize or nullify them that means seeing a lot of Zero values in your dashboard.

When I was trying to create this alphabet in some cases/letters I was really in big dilemma which word/term to cover. For instance the Sonar runner, which is not mentioned above, is the proposed and standard way to analyze any project with Sonar regardless the programming language.

If you think that an important Sonar term is missing feel free to comment and I’ll adjust the text.



agile

clock September 2, 2012 23:01 by author Administrator

We are uncovering better ways of developing
software by doing it and helping others do it.
Through this work we have come to value:

Individuals and interactions over processes and tools
Working software over comprehensive documentation
Customer collaboration over contract negotiation
Responding to change over following a plan

That is, while there is value in the items on
the right, we value the items on the left more.



before check in the code

clock September 1, 2012 22:16 by author Administrator

Before checking in the code, each developer should make sure that:
1. Should have a Unit/Integration Test for the change/new feature
2. Run Code Quality Checking tools(FindBugs/PMD/Sonar) on the changed code
3. The changes should comply with the existing architecture/design of the application.



prototype

clock August 31, 2012 14:14 by author Administrator

 

A picture is worth a thousand words.

A prototype is worth a thousand lines of code.


Prototypes Are For Two-Way Communication

The key element, and the reason for creating prototypes, is to get two-way communication. A prototype is not just a status update about your design.

A prototype is the start of a conversation.

Prototyping is not only useful for design conversations, it is critical to understanding your requirements. Yes, a prototype will you get feedback about the design-execution of your proposed solution. More importantly, a prototype can help you make sure you’re solving the right market problems.

 



About the author

 Welcome to this web site . This page has two purposes: Sharing information about my professional life such as articles, presentations, etc.
This website is also a place where I would like to share content I enjoy with the rest of the world. Feel free to take a look around, read my blog


Java,J2EE,Spring Framework,JQuery,

Hibernate,NoSql,Cloud,SOA,Rest WebService and Web Stack tech...

RecentPosts

Month List

Sign In