Tuesday, February 20, 2018

Design Patterns

Design Patterns

In software engineering, a design pattern is a general repeatable solution to a commonly occurring problem in software design. A design pattern isn't a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations.

Uses of Design Patterns

Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. Reusing design patterns helps to prevent subtle issues that can cause major problems and improves code readability for coders and architects familiar with the patterns.
Often, people only understand how to apply certain software design techniques to certain problems. These techniques are difficult to apply to a broader range of problems. Design patterns provide general solutions, documented in a format that doesn't require specifics tied to a particular problem.
In addition, patterns allow developers to communicate using well-known, well understood names for software interactions. Common design patterns can be improved over time, making them more robust than ad-hoc designs.


Behavioral Patterns


  • Command
  • Iterator
  • Observer
  • Strategy
    • https://dzone.com/articles/java-the-strategy-pattern

Creational patterns


  • Abstract Factory
  • Factory Method
  • Prototype
  • Singleton

 

Structural patterns



  • Adapter
  • Bridge
  • Composite
  • Facade
  • Proxy

Software Testing

Software Testing is the process of identifying the correctness and quality of software program. The purpose is to check whether the software satisfies the specific requirements, needs and expectations of the customer. In other words, testing is executing a system or application in order to find software bugs, defects or errors. The job of testing is to find out the reasons of application failures so that they can be corrected according to requirements.

Testing Levels 

Functional Testing 

  • Unit Testing
  • Integration Testing
  • Smoke Testing
  • Sanity Testing
  • System Testing
  • Regression Testing
  • User Acceptance Testing  - UAT
    • Alpha Testing & Beta Testing
  • End-to-End Testing

Non Functional Testing 

  • Performance Testing
  • Load Testing
  • Stress Testing
  • Security Testing
  • Reliability Testing 



Friday, January 26, 2018

Java Decompiler

The “Java Decompiler project” aims to develop tools in order to decompile and analyze Java 5 “byte code” and the later versions.





http://jd.benow.ca/

Sunday, January 14, 2018

JMeter Using CSV DATA SET CONFIG

JMeter, an open source load testing tool, has an element that allows you to use external data sets in a CSV format. This element is called the “CSV Data Set Config”. The CSV Data Set Config is used to read lines from a file and to split them into variables.  


Find details here

Saturday, January 13, 2018

Linux Sed commnad (Replacing and Filtering )

The Linux operating system makes use of terminal commands to work with a computer's file system. The primary use of the Linux command sed, which is short for stream editor, is to modify each line of a file or stream by replacing specified parts of the line. It makes basic text changes to a file or input from a pipeline. 

For example, say you have a file named "songs.text" that contains these lines:


1, Justin Timberlake, Title 545, Price $6.30
2, Taylor Swift, Title 723, Price $7.90
3, Mick Jagger, Title 610, Price $7.90
4, Lady Gaga, Title 118, Price $6.30
5, Johnny Cash, Title 482, Price $6.50
6, Elvis Presley, Title 335, Price $6.30
7, John Lennon, Title 271, Price $7.90


Making Text Substitutions With Sed

If you want to change all price occurrences of $6.30 to $7.30, you can make the changes using the sed command in this way:


sed 's/6.30/7.30/' songs.txt > songs2.txt


This code makes the change and writes the modified file to "songs2.txt". The output file contains:


1, Justin Timberlake, Title 545, Price $7.30
2, Taylor Swift, Title 723, Price $7.90
3, Mick Jagger, Title 610, Price $7.90
4, Lady Gaga, Title 118, Price $7.30
5, Johnny Cash, Title 482, Price $6.50
6, Elvis Presley, Title 335, Price $7.30
7, John Lennon, Title 271, Price $7.90


If you want to replace all occurrences of "Cash" with "Trash" you use:


sed 's/Cash/Trash/' songs.txt > songs2.txt


which creates a file with content:


1, Justin Timberlake, Title 545, Price $7:30
2, Taylor Swift, Title 723, Price $7.90
3, Mick Jagger, Title 610, Price $7.90
4, Lady Gaga, Title 118, Price $7:30
5, Johnny Trash, Title 482, Price $6.50
6, Elvis Presley, Title 335, Price $7:30
7, John Lennon, Title 271, Price $7.90



Filtering With the Sed Command

Sed is also frequently used to filter lines in a file or stream. For example, if you only want to see the lines containing "John," you use:


sed -n '/John/p' songs.txt > johns.txt


which writes the following lines to file johns.txt:


5, Johnny Trash, Title 482, Price $6.50
7, John Lennon, Title 271, Price $7.90



https://www.lifewire.com/example-uses-of-sed-

Thursday, January 4, 2018

How do I search my command-line history for commands I used before?

Press Ctrl+R and type sshCtrl+R will start search from most recent command to old one (reverse-search). If you have more than one command which starts with ssh, Press Ctrl+Ragain and again until you find the match.
Once you've found the match you can press Enter to execute the command or left / right cursor to just select the text of the command.
There is no default reverse option for Ctrl+R to invert the direction of the search but here you will find some suggestions about it.

Thursday, December 28, 2017

Zipping and Unzipping Files in UNIX

There are several methods of archiving files and retrieving archives. I recommend using the “zip” function to compress your files for its ease of use and portability. (Files zipped in Unix can be extracted using various tools on various platforms including Windows).
Below I have provided various “unzip” methods. The “right” unzip method depends upon the method used to zip the file. You can tell the zip method by the file extension (e.g., .zip.tar.gz, etc.)

Zipping Files Using ZIP

This Unix program is compatible with the zip program for Windows and most other operating systems. To zip files, first have the files uploaded to your server, then log into your account with SSH. Navigate to the directory where the files are that you want to zip (for instance by typing cd www then cd sounds to move to your/www/sounds directory). Then type:
zip myzip file1 file2 file3
This puts the files named file1file2, and file3 into a new zip archive called myzip.zip.

Unzipping Files

Please note that the unzip method you use is defined by the filename you are trying to unzip. For example, if you are trying to unzip a file called file.tar – you would use the method described in “tar“. Files ending in .gzip or .gz need to be extracted with the method described in “gunzip“.

Zip

If you have an archive named myzip.zip and want to get back the files, you would type:
unzip myzip.zip
Typing zip or unzip by itself will give you a usage summary, showing nearly all the options available.

You can compress whole directory using the following command:
zip -r squash.zip dir1

Tar

To extract a file compressed with tar (e.g., filename.tar), type the following command from your SSH prompt:
tar xvf filename.tar
Basically, this command means that you will see the file “explode”, so don’t worry when you see your screen scrolling wildly. It also means that you will see any errors in the archive.

Compress / zip it with command tar -cvzf new_tarname.tar.gz folder-you-want-to-compress
In this example, compress a folder named “scheduler”, into a new tar file “scheduler.tar.gz”.
$ tar -cvzf scheduler.tar.gz scheduler

Gunzip

To extract a file compressed with gunzip, type the following:
gunzip filename_tar.gz
then if you receive no errors, type:
tar xvf filename_tar

5 Strategies for Getting More Work Done in Less Time

Summary.    You’ve got more to do than could possibly get done with your current work style. You’ve prioritized. You’ve planned. You’ve dele...