Thursday, 22 September 2016

TNS Names in Oracle Database

TNS (Transparent Network Substrate) names are contained in a file called tnsnames.ora, that defines outgoing database requests.
It contains all database names (SIDs) running on the processor.
When a new database is added to a box, the file /etc/tnsnames.ora must be updated otherwise you won't be able to connect to the database in PL/SQL Developer.
This file also describes each domain name, including protocol, host, port and service name information .

You can find TNS Names in PL/SQL Devloper by navigating to the 'Help' menu in menu bar and under that; 'Support Info'. Once you click on 'Support Info' a small window will appear containing six tabs; and in these tabs you will find one with the name "TNS Names". 

Wednesday, 24 February 2016

Bug Life Cycle

Bug Life Cycle (Defect Life cycle) is the journey of a defect from its identification to its closure. The Life Cycle varies from organization to organization and is governed by the software testing process the organization or project follows and/or the Defect tracking tool being used.

Nevertheless, the life cycle in general resembles the following:
  1. NEW
    When the bug is posted for the first time its status is NEW.
  2. ASSIGN:
    When the lead of testing team feels that the bug is genuine, he assigns the bug to the development team, hence the status is changed to ASSIGN.
  3. OPEN:
    When the developer analyzes and works on the bug to fix it, the status is changed to Open.
  4. FIXED:
    When the bug is fixed by the developer, the status is changed to Fixed.
  5. PENDING RETEST:
    After fixing the bug the developer give the specific piece of code to the tester to test again, hence the bug is at the tester’s end so the status is changed to Pending Retest.
  6. RETEST:
    The tester tests the bug again so the status is Retest.
  7. VERIFIED:
    After testing again if the tester feels that the bug is now fixed, he/she changes the status to Verified.
  8. REOPEN:
    If the tester feels that the bug is still not fixed, he/she change the status to reopen.
  9. CLOSED:
    If the bug is fixed, the status is changed to Closed.
  10. DUPLICATE:
    If the bug is repeated twice or the two bugs mention the same concept of bug, then one bug is changed to duplicate.
  11. REJECTED:
    The status is changed to Rejected if the developer feels that the bug is not genuine.
  12. DEFERRED:
    The status is changed to deferred if the developer feels it might be fixed in the later releases or the bug has low priority.
  13. NO BUG:
    The status is changed to No Bug if there is no change in functionality of the application.

Monday, 22 February 2016

Service Level Agreement (SLA)

A service level agreement is a contract between the service provider and the end user that defines the level of service expected from the service provider. It focuses on WHAT is delivered not on how it is delivered.
SLAs measure the service provider’s performance and quality in a number of ways. Some metrics that SLAs may specify include:
  • Availability and up-time -- the percentage of the time services will be available.
  • The number of concurrent users that can be served.
  • Specific performance benchmarks to which actual performance will be periodically compared.
  • Application response time.
  • The schedule for notification in advance of network changes that may affect users.
  • Help desk response time for various classes of problems.
  • Usage statistics that will be provided.
SLAs are a critical component of any vendor contract. Beyond listing expectations of service type and quality, an SLA provides remedies when requirements aren't met.


Friday, 19 February 2016

Requirements Trace-ability Matrix (RTM)

In the previous post I discussed the software Testing life cycle and in the design phase of the STLC a requirements trace-ability matrix is designed.
So let's discuss what requirements trace-ability matrix is.

Requirements Trace-ability Matrix:

The Requirements Trace-ability Matrix (RTM) is a document that links requirements throughout the validation process. The purpose of the Requirements Trace-ability Matrix is to ensure that all requirements defined for a system are tested in the test protocols.

Thursday, 18 February 2016

Software Testing Life Cycle (STLC)

Software testing life cycle refers to a testing process which has specific steps to be executed in a definite sequence in order to meet the quality goals.
In STLC process, each activity is carried in a planned and systematic way. There are some phases of STLC that varies through organizations but the basis remains the same.

Phases of STLC are:
  • Requirements Phase
  • Planning 
  • Design
  • Test Environment Setup
  • Test Execution
  • Test Reporting

  1. Requirements Phase:
    During this phase, analyze and study the requirements. Have brainstorming sessions with other teams and try to find out whether the requirements are testable or not. This phase also defines the scope of the testing. If any feature is not testable communicate it so that the mitigation strategy can be planned.
    In short you review the software requirements/design if they exist and carry out ‘Review Defect’ reports.

  2. Planning Phase:
    In practical scenarios, test planning is the first step of the testing process. In this phase we identify the activities and resources that would help in meeting the testing objectives. During planning, we also try to identify the metrics and the methods of gathering and tracking those metrics.
    Once you gathered a general idea of what needs to be tested you plan for the tests.
    Test plan, test estimation and test schedule are the deliverable s.

  3. Design Phase:
    Design and detail the tests on the basis of detailed requirements/design of the software. 
    Test cases, scripts, tests data and requirements trace-ability matrix are deigned.

  4. Test Environment Setup:
    You setup the test environment (server, client, networks etc.) with the goal of replicating the end user’s environment.
    Deliverable: Test Environment.

  5. Test Execution:
    Execution of test cases in the test environment to see whether they pass, and carry out the test results and defect reports.

  6. Test Reporting:
    You prepare various reports for various stakeholders and carry out final test results, test/defect metrics, test closure report.
      

Saturday, 12 April 2014

Enums in C#

An enum is kind of construct that you can use to make your code easier to work with. The enum construct is useful when you want to create a method that has multiple modes. A good example is the constructor for the CryptoStream class. The CryptoStream constructor accepts CryptoStreamMode.Read or CryptoStreamMode.Write as one of its arguments. This is a simple enum.

Enum is short form enumerator. Enumerating something literally means assigning numbers to it. An enum takes meaningful names and assigns numbers to them.

An enum object doesn't take up any more memory than a standard int variable, so there is no good reason not to use them to make your code clearer and easier to understand. As well as making your code more readable, enums also make methods easier to use; this makes them particularly useful in class libraries.

Friday, 11 April 2014

Garbage Collector

The Garbage Collector is a special feature of C# that automatically clears objects from memory when they are no longer needed. For example: once a method is finished executing, the garbage collector removes any variables it used from the memory. Thanks to the garbage collector it is very rare for C# applications to suffer from memory leak issues when the program uses up more and more memory until it overloads the system.

The garbage collector will work automatically without you needing to do anything but you can send commands to it by using the GC class. The GC class can also provide some useful information about memory usage.
It is important to note that using the GC class can potentially make your project less memory efficient. The garbage collector files your objects into one of three categories or generations.

Generation 0 contains objects that will be disposed off quickly such as variables within methods. Generation 1 contain objects that are expected to remain in memory for longer, a public property of a class might be a generation 1 object. Generation 2 contains objects that are expected to remain in memory for a very long time such as static classes.

When the garbage collector cleans up memory, it promotes any object that is still in use to the next generation. Misusing the GC class can lead to objects being promoted to inappropriate generations and remaining in memory for longer than they should.

Monday, 7 April 2014

Difference between Class and Struct

A struct is a construct that is almost identical to a class.
The major difference is that structs are value type objects while classes are reference type objects. This means that when you pass a struct object to a method, the method will receive a copy of the object and wont be able to make changes to it outside the method.
It is usually best to use classes instead of structs as there are many features of classes that aren't supported by struct objects. However it is not possible to pass a class object by value so if there is s special need to do this you may find struct more appropriate.

The limitations of structs are that they cannot have constructor methods without any arguments and they cannot extend classes nor can classes extend structs.

Because structs are value type objects, this means that they are stored in the stack. Whereas class objects are stored in the heap. Because struct objects are stored in the stack they will generally be slightly faster than class objects. It is best to avoid using large structs as there is a limited amount of space in the stack, you should only use structs for small constructs that need to be accessed quickly.

Sunday, 6 April 2014

C# Lazy Class

When you create a variable in C# it immediately reserves a space in memory even if you don't assign a value to it. For example: if you create an int variable it immediately reserves 32 bit of memory. It is very rare for this to be an issue but there may be cases when you need to work with a class that consumes enormous amount of memory.

In these cases you can use the Lazy class to prevent the object from being loaded into memory until it is needed. This is called Lazy instantiation. If you follow good coding practices, its extremely unlikely that you'll ever need to make use of the lazy class.

An important note when working with Lazy objects is that their constructor methods will not run until they are loaded into memory.

Friday, 4 April 2014

C# Tuple Class

The Tuple class is a new feature of ASP .NET 4.0 that enables you to very quickly create custom data structures similar to classes. Tuple objects can't contain methods, they are only structures for data storage. It is best practice to avoid using Tuple as where possible as they don't have the flexibility of real classes and can make your code harder to understand.

Tuple objects offer an easy way to return multiple values from a method. It is important to note however that it is better to do this using either the out keyword or ideally returning a custom class.
Tulple objects have a limit of eight properties, although you can nest Tuple objects by using Tuple as a property type within another Tuple. You need to set the values of a Tuple object's properties when you create it. After the Tuple object has been created it's values will be read only.
Once a Tuple object is created, it will behave in exactly the same way as any other object that has read-only properties.

As well as creating a Tuple object using the standard method of instantiating a class, you can also use the Tuple.Create method. The only reason to use this method is to cut down on the amount of code you need to type as the Create method will automatically select the correct data types for the values you provide.

Thursday, 3 April 2014

ASP .NET Master Pages

A Master Page is a way of storing your site layout in a single file which you can then assign to many pages. The site that is automatically generated when you create a new ASP.NET web application includes a master page. By using a master page you can avoid having to manually update each page when a minor change is made to your site layout.
The disadvantage of master pages is that you lose the ability to completely customize each page.

The ContentPlaceHolder is a special control that is only available on master pages. It is used to define areas that can be edited on pages that use the master page. The ContentPaceHolder appears in the standard category of the toolbox.

Tuesday, 1 April 2014

Difference between Web Application Project and Website Project

Web Application projects are generally a better option then website projects for two reasons: Firstly because website projects are not compiled; the web server has to compile them as the site is viewed, this makes websites slightly slower then web applications.
Secondly because web application projects are compiled; so the code of the website they produce will not be easy to edit, this prevents the website from being tampered with and allows you to protect your source code.

In your professional career you might have to work on a website project that was created by another developer, in this case it is useful to convert it into a web application project.

Monday, 31 March 2014

Why C# is a Type-Safe Language

"It is impossible to write unsafe code in C#". Some programmers think that this statement is not 100% correct but it is correct and C# is definitely a type-safe language.

C# enforces its variable types very strongly for ex: this means that C# is always aware that an int variable will contain a whole number and nothing else; because of this C# is considered a type-safe language. Some other programming languages allow variable to be created without fixed data types which can lead to errors that are very hard to debug.

Saturday, 29 March 2014

Global.asax

Global.asax contains event handlers that are related to your applications and user sessions. Global.asax also contains an event handler that runs whenever an error happens anywhere in your application. By using Global.asax you can intercept every error that happens on your site. There are other event handlers in Global.asax that can also be useful.

Application_Start:
Runs when your site is started by the web server.

Application_End:
Runs when your site is stopped by the web server.

Application_Error:
Whenever there is a server error on your site.

Session_Start:
Runs when a user arrives at your site and start a new session.

Session_End:
Runs when a user session ends.

The most likely use of the Session_Start and Session_End events would be to log details of users when they arrive at your site.

You can also add other event handlers to Global.asax. There are many other application events that Global.asax can handle. A useful example is the Application_AuthenticateRequest event which runs before any page is served to a user, some programmers use this to implement their own custom login systems when they have special requirements that go beyond the built-in security features.

Friday, 28 March 2014

Stored Procedures

Store Procedures are similar to methods but are stored inside the database. Store Procedures contains SQL code that can manipulate data in ways that would be difficult using C#. In a team environment store procedures are usually written by the DBA.

Store Procedures can have arguments and return values just like any other method. Store Procedures can do everything LINQ can do and usually be faster and more efficient. Using Store Procedures for everything might seem ideal but having hundred's of store procedures in a database often becomes unmanageable and difficult to maintain. I recommend using LINQ for simple everyday queries and store procedures for anything more complicated or if you see performance issues.

Using Store Procedures centralizes your SQL code on the database server and makes it easier to maintain your code if the database changes.