2013/03/28

The system administrator standing top ten open source tools

It is said that the online flooded with more than 50,000 kinds of systems management tools - and the open source version has all the tools you need. , Sourceforge, currently lists more than 405,000 items, with over 25,000 system administrators tools - more than 21,000 of the Linux system under Windows for nearly 15,000. We elected you often need some tools can make your job easier.

1. Wireshark

Wireshark before the year 2006 called Ethereal, it is one of the most powerful network tools. The software to capture and analyze the Ethernet, IEEE 802.11, PPP, raw USB and a local connection of the data packets, are particularly useful for network troubleshooting. You can filter by displaying custom display, create plug-ins to support the new agreement, the captured file can be edited or converted via command line input.

Supported operating systems: BSD, Linux, Mac OS X, Windows, UNIX

License: GPLv2

2. Virtuawin

VirtuaWin is a Windows virtual desktop manager that allows users to display up to 20 virtual desktops. The software runs in the background, using the shortcut on the virtual desktop access. The most important is that the program as well as a mobile version, U disk lets you carry your desktop. VirtuaWin support dual monitors, and can be customized icon in the system tray.

Supported operating systems: Windows 95 or above

License: GPL

3. PhpMyAdmin

phpMyAdmin can use the Web browser interface manage MySQL database. The software uses a PHP developer, you can use the global database or use the custom the subset search queries, custom query by Query-by-example (QBE) to create. phpMyAdmin can create and delete database; create, delete and change table; delete, edit and add domain; execute SQL statements. Data import formats including CSV and SQL, data can be exported to CSV, SQL, XML, PDF, OpenDoc, and DOC, Excel and LATEX format. There is also a database layout save a PDF file functionality.

Supported operating systems: run cross-platform, browser.

License: GPLv2

4. Pandora FMS

Pandora FMS (Flexible Monitoring System) is a small and large systems environment (a server node), the availability and performance monitoring system. For the local system, the software agent to monitor the Linux, Solaris, FreeBSD and MAC OS X, Windows and AIX platforms, the numerical parameters, Boolean state or string. Users can use to create a proxy Shellscript, WSH, Perl or C. Remote network monitoring via SNMP v3, TCP check and remote WMI detection. The data report based Pandora own SQL background, and may be displayed on the configuration screen.

Supported operating systems: Linux

License: GPLv2

5. Process Hacker

Process Hacker is a comprehensive process viewer under Windows, the function is not only the end of the process, as well as the memory view and edit. This tool is particularly useful in that it can bypass the security software and systems for defense, some to force visualization function, for example, a thread waiting for events, the ability to restart the process to create the process dump to see if the process heap The injected DLL memory dump to a file, edit service properties.

Supported operating systems: Windows 32-bit, 64-bit

License: GPLv2, GPLv3

6. Notepad + +

Notepad + + is a convenient source code editor, you can replace Notepad that comes with Windows. Unlike the basic Windows tools, the software has a WYSIWYG printing, bookmarks, support tab stops, macro, start switch, auto-completion, syntax highlighting, zoom and multi-document support and other functions. The program has a long list of features, all the coding tools are displayed in the toolbar, it maintains the look and feel of the editor of a unique kind of lightweight most Windows software.

Supported operating systems: Windows 95 or above

License: GPL

7. Swiss File Knife

SFK including 96 function in a command-line functions. The tools include Task Category file system commands (directory and the directory tree), file conversion (for example, the hexadecimal data into binary), text processing, text / file search and compare (as in the binary file lookup field ), the network, the script (such as running HTTP and FTP servers), software development (including the conversion of binary data to the source code).

Supported operating systems: Windows XP or above, Linux (Ubuntu, DSL), Mac OS X

License: BSD

8. LDAP Admin

One of the best directory management tools LDAP server is used to browse, query, modify, create and delete objects recently added Unicode support, an enhanced picture viewer, content highlighting, and AD support. As a free alternative to expensive procedures such LDAP Admin Tool or LDAP Administrator, the feature set is not very extensive, but you can still run complex tasks, such as copy a directory in the remote server, modify the operation of the data set, using the password management Manage the Posix group and account.

Supported operating systems: Windows

License: GPLv2

9. RackTables

If the spreadsheet is no longer the ideal solution for tracking data center equipment, then RackTables the asset management program may be more beneficial solution. Use the software, you include all of the components in the data center, including hardware assets, network addresses, rack space and network configuration. Still at an early stage of development, lack of some features, such as the limited number of switches support, but covers IPv4/IPv6 address management software, 802.1Q VLAN, CWDM and DWDM channel grid, as well as through CDP and LLDP neighbor discovery.

Supported operating systems: Windows, Mac OS X, Linux

License: GPLv2

10. Areca Backup

Areca Backup is a simple, but very effective backup solution that allows you to select a group of files or directories to be backed up and configure a custom backup behavior. The backup program supports ZIP ZIP64 format AES128/256 encryption, local or network drive, backup storage, incremental backups of file filters, file merging, data recovery, backup report. Users can create a script to run when the backup is complete. The software has a graphical interface and command line.

Supported operating systems: Windows 32-bit, Mac OS X, Linux

License: GPL


Traditional software testing problems and solutions

Traditional software testing process: small amount of unit testing in the software development process. Then end stage throughout the software development, focus on a large number of tests, including the function and performance of the integration testing and system testing. With the increasing complexity of software development, software testing process inevitably brings us the following question:

One problem: difficult to control the progress of the project, project management more difficult.

A large number of software errors often only to the system test phase of the project late been discovered to solve the problem of the time it takes to be difficult to predict, and often lead to the progress of the project can not control, a lack of understanding of the quality of projects throughout the software development process, project management and control, increase the difficulty of project management.

Second problem: weak project risk project risk control in the late project development can really reduced. After system testing before really determine whether the design truly meet the needs of the system functionality, performance and reliability.

Question three: software project development costs exceed the budget. The later errors found in the entire software development cycle, the higher the cost of the unit bug fixes, error delay to solve the entire cost of the project is bound to lead to a sharp increase.

The successful experience of the IBM Rational Software automated testing to solve the problem of the traditional test.

The core of the successful experience of the three best: early testing, continuous testing, automated testing, and on this basis to provide a complete software testing process and a set of software automation tools, so we eventually be able to do: a test team, based on a complete set of software testing process, the use of a complete set of automated software testing tools, and complete a full range of software quality verification.

Successful experience: as soon as possible to test

The so-called as soon as possible to test an idea through a variety of software engineering in the entire software development cycle as early as possible to complete a variety of software testing tasks. IBM Rational software engineering techniques early test for us in the following three aspects:

First of all, the entire testing life cycle of the software is essentially flush with the software development life cycle process. When demand analysis basic clear we should be based on a needs analysis of the results, and the entire project plan for software test plans; along with the analysis and design process should be completed test case design; When the software's first release came out, the test to immediately based on its implementation of test scripts and execute test cases based on the purpose of the test in the test plan, the assessment report of the test results. In this way, we can index real-time monitoring of various test project quality status, to improve the control and management of the entire project.

Project planning, demand management --- test plan

Test plans, analysis of the design --- test design

Test design --- test implementation

Test --- test results assessment

Secondly, through the iteration is software development to the original of the entire software development life cycle is divided into multiple iteration cycles, and in each iteration cycle test system testing time in advance, so largely, largely reduce project risk and project development costs.

Finally, IBM Rational early test of successful experience is also reflected in the expanded developer testing and system testing traditional testing phase from unit testing, integration testing, system testing, acceptance testing division of the entire software testing phases divided into two stage. Software testing duty bound to extend to the the developers work of the entire development process. Through advance testing time to improve the quality of software testing as soon as possible, to reduce the cost of software testing.

Successful experience: continuous testing

The test successful experience continuous test is derived from iterative software development model. Iterative method, we target the entire software development is divided into a series of small targets easier to implement and achieve these objectives are defined clear stage evaluation criteria. Iterations is engaged in a series of development activities in order to complete certain milestones must be based on the current state of the project and the milestones to be achieved before the start of each iteration develop iterative scheme and each iteration of the process including requirements development, design, coding, integration, testing a series of activities will be incremental integration of new system functions. Each iteration to generate a running system. System can run tests to assess the iterations have not reached the predetermined iteration goals, and as a basis to develop the next iteration. Thus, in each iteration of the iterative software development cycle, we will carry out activities of software testing, and completion of the entire software testing through each iteration cycle constantly incremental testing and regression testing.

Successful experience: automated testing

Should test as soon as possible in the whole process of software testing, continuous testing, can be said to improve the testing process is automated testing tools is to ensure that. The successful experience of the IBM Rational automated testing refers to the use of software testing tools provide complete support of the software testing process and various test automation implementation.

Addition to the test in order to make the software testing team, IBM Rational provides test successful experience, also provides us with a complete set of software testing processes and automated testing tools, software testing team can take time to complete the test task.


2013/03/27

For the agility of the top five misconceptions

Myth: agile people demanding

Many people try to implement agile: agile requirements too high, we do not have such conditions, we do not have the people, so we can not agile. However, agile requirements really that high?

Software in the final analysis, is also a creative activity, developed the skill level and personal capacity plays a decisive role in the quality of the software or just a variety of processes and methods to help developers, testers and other roles to better cooperation, resulting in higher productivity. Regardless of the method, the developer level is always a major factor.

From another point of view: the process and methods of what help developers how big favor? Is about the same for the lower level of technology developers, agile methods and traditional methods to help him, so to see a less than significant effect, even when there are opposite effect; With the improvement of the technical level of the developer, agile methods be able to unlock the shackles, encourage innovation, and the effect will be more significant.

Agile requirements, and will help you develop the necessary capacity, of course, if you are in really agile environment.

Myth: agile design document, nor do

This misunderstanding from the XP start did not stop, XP encourage non to be necessary and of great significance not write the document. There mentioned "necessary and of great significance" is a criterion, not all documents are not written. For example, the user manual is not necessary and significant "? This depends on the requirements of the customer, if the customer does not need, then they do not need to write, if the customer needs, you must write; Another example, the architecture design document or else write? Complicated to write complex do not write. Architecture design usually only need a relatively simple document, for some projects, a simple UML diagrams is enough. Therefore, write, do not write, how to write, how much significance should be the basis of this document in the end, the decision of the proportion of outputs and inputs, as well as the specific circumstances of the project. Actual operation allows all project team personnel to vote, to be avoided by an individual (such as lead).

As for the design, XP pursuing sustainable design, and not without design. This is actually the design work allocated to day-to-day work, constant design improvements (reconstruction), the design has been kept flexible and reliable. As for the pre-design before coding, Kent Beck et al really practiced without any pre-designed development, but for those of us non-guru "level developers, the necessary pre-designed or need, just not too much, not too fine, there must be the will to overturn ready.

Misunderstanding number three: good agility, and other methods is not good

Some people mention dexterity shouted agile practice anything mentioned CMMI methods such shouted bad, no matter what as long as the stained side on where not good, seems agile and other methods is completely opposite. Newton said that, I am standing on the shoulders of giants. Agility also draw other methodological advantages, but also standing on the shoulders of giants, agile remains many historic practices and principles just different manifestations Bale.

From another perspective, the present do not have a good ring, good or bad depends on whether it is suitable to solve your problem. Each method has the most good at solving problems and the best play environment, demand is stable, and the era of software complexity is relatively high, the waterfall model can also work well, while Min Jieqia good applies to the risk of changes quickly The project - which is precisely the many projects in common.

Therefore choose a method or process, and not according to whether it is agile, but should be based on whether it is suitable. Learned a thing suitability, or want to try to understand things are not proven untrustworthy.

Misunderstanding: Agile XP, Scrum

XP and Scrum are just two of the many agile methods, as well as many other agile methods. The different dragon have nine sons, agile methods look is a big difference, but the reason they are called agile methods, because their underlying philosophy and principles are the same, this principle is "Agile Manifesto". Learning agile not only to study and practice, but also to understand the principle in practice, not only to understand how to do it, but also to understand why they do, and when not to do so.

XP or Scrum full application of your project, but also might not be able to successfully, for others may not be suitable for you. These practices and methodologies agile gave us a starting point, but certainly not the end, the best way for you, but also your own explore and find practical work.

Myth five: agility well, so I want to develop a standard, all projects must follow the standard

Which two projects are the same, the customer is not the same, the staff is not the same, the demand is not the same, not even what may be the same. Not the same environment and problems solved, using the same method, is good is impossible to solve. By serving others, you should find the most suitable method for the project team to determine the method and not let the team to adapt this method. Therefore there was no uniform for all items. Any attempt to unify all the project process methods are incorrect.

The same time, for the same team as the project progresses, needs to understand the depth, the depth of technical understanding, the beginning of the process and methods will gradually not suitable. At this time also timely adjustment process requires a team to ensure the quality and efficiency of the project. Agility is dynamic, rather than static, because this world is change, change the world use the same method, it is unrealistic. Silver bullet never had, and would not exist in the limited future.


loadrunner recording ftp protocol script

The FTP protocol is a low-level protocol used to simulate the action of the user on the ftp server, such as landing, transfer files, disconnected operation
The script can be generated by recording the FTP session or manually enter ftp function
Steps:
Open vuser, the new catalog select E​​-business, select the ftp protocol
Pop-up recording options, select ie, or win32 applications (ftp client)
3.ftp operation finished recording, generate the script
Commonly used functions:
* ftp_login
Log ftp
Syntax: init ftp_logon (char * transaction char * url [attributes] LAST);
Example: ftp_logon (FTPlogon, URL = ftp://test1:123456 @ servaername: port ", LAST);
If anonymous users compared with anoymous, the port number can be omitted
* ftp_logout: canceled ftp connection
Syntax: int ftp_logout ()
Example: ftp_logou ();

* ftp_Logon_ex specified session login ftp
Syntax: int ftp_logon_ex (FTP * ppftp, char * transaction, char * url attributes,] LAST);
Example: ftp1 = 0;
ftp_logon_ex (& ftp1, "ftplogon", "url = URL = ftp://test1:123456 @ servaername", last)

* ftp_put to upload files to ftp server
Syntax: int the ftp_put (char * transaction <item list> LAST);
Example: the ftp_put (the "the ftp_put" "source_path ftpfile_1.dat", "target_path = temp / test.txt" LATS);
* ftp_get get the file from the ftp server
Syntax: int ftp_get (char * transaction <item list> LAST);
Example: ftp_get ("ftp_get", "source_path = / home / test.txt", "target_path = d :/ test.txt", the "PASSIVE = TRUE" ENDITEM, LATS);

the * ftp_dir specified directory Run the dir command
Syntax: int ftp_dir (char * transaction <item list> LAST);
Example: ftp_dir (the "ftp_dir, path = pub / test" LAST);
 Display the files and subdirectories in the test directory
* ftp_delete: delete the ftp file
* ftp_rendir: rename files
* ftp_rmdir: delete folders
* ftp_mkdir: create a folder


2013/03/26

Web software test data input checklist

Checklist (Checklist) can help testers to save time, because many effective methods are not needed for each test rediscovered predecessors have been full summary, and a lot of validation Secondly, the checklist help testers to avoid missing person's memory is limited, inevitably there will be missed by the checklist checks can be effective to prevent the omission. Recently, IBM engineers Sujing Gang summarizes checklist of Web software test data input, and provides a good reference for Web testers.

Su Jinggang major input from the form data validation, data consistency, date input, digital input, the input of numeric characters summarized the main points need to check the Web test. Digital input, for example, which is a common test point checklist includes six elements:

1, to ensure that the minimum, maximum, correctly handle - For digital input domain, typically has its own maximum value and the minimum value of these two extremes processing requires special verification. In addition to verify the minimum and maximum values, the best testers with validation smaller than the minimum value, and the value is larger than the maximum that can be proper handling. For example, the need to enter a port number in the process of defining a connection, the minimum value of the port number 1. When the user input port number is 0, can be successfully added to the connection. When the user to verify the connection when prompted port number 0 is illegal. This is a defect in the product. The correct approach is When users view add the port number to 0, it gives the error message informing the user that the port number is illegal. A need to look at the place, when the input exceeds the maximum minimum, products need to give clear warnings and tips, inform the user what is the correct range.

2, to ensure that the numerical input box the first character position to enter a space error - When numerical input box characters to spaces when the input is no longer a value should be doing illegal input processing. Product process, you need to give an error message.

3 to ensure that the last character position of the input value of the input box to enter a space error - numerical input box last character to spaces when the input is no longer a value should do illegal input processing. Product process, you need to give an error message.

4, to ensure a positive sign (+) and the negative sign (-) is correctly processing - each relates to the numeric input are related to the problem of a numerical symbol. Because values ​​have positive and negative points, we need to ensure that the processing of positive and negative numbers are accurate and appropriate. Able to accept input box with a positive sign value, the processing results should talk without symbols (default is positive), the results of the numerical input, because in essence, the two values ​​are equal (except longer show the input values, because simple display on the difference of a + sign).

5, the divisor is 0 - divisor of 0 is the need to avoid all operations. Software products, if it comes to the division operation, you need to pay special attention to avoid division by 0 occurs. Which contains a variety of case the divisor is 0, the divisor is the input value of 0, the divisor is a middle results 0.

6, in all operations of adding 0 - 0 All the operator has an important role, and is also a very special value. Therefore, during the test, in all relates to the operation value of 0 has a good effect of the test product, can be tested to more 0.

Similarly, the list of data consistency test and boundary value:

1, check Enter the maximum character length working properly - each input domain has its own input character length limit, when the input length is the maximum length, the need to ensure that the product display and work properly. Usually belong to the maximum length of the character, to the difficulty of the page display great challenges, because of the limited page content displayed maximum.

2, verify digital input domain whether to accept the negative and whether it is reasonable to accept negative values ​​- digital number with area some cases should not accept negative input, then if not handled properly, when the negative input, there will be unpredictable situation. If allowed to accept the negative, test whether the processing of a negative test important.

3, to ensure that the data is saved all values ​​in the database have been complete save - save the data on the product page, you need to make sure that all values ​​are saved to complete the database. Access to the same data from different sources are consistent, synchronized. To verify this, the testers need to try to re-open after save and view the display, to see whether it is fully consistent with the data before saving, while trying to verify whether it can get consistent results from different path to access and apply the same input.

Data validation testing is often overlooked, Su Jinggang summarizes the three test points:

1, at any time when illegal data is entered, the system can perform poorly - software products designed for the purpose of not only receiving illegal data input, but the products need to ensure that when illegal data is still not bad, and still should make appropriate processing. Are many types of illegal data, including of data illegal characters in length, the size of the data, the data, the order of data input.

2 What are the consequences if the user is in the process of product use, remove the cookie will be? - Cookie is a product in order to identify the user and save user configuration information, session tracking and data stored in the local terminal. Product design needs to ensure that the user, if the user deletes cookies, the product is still handled properly, there will not be too bad, unpredictable behavior.

3, if you delete the cookie using the product will be the consequences? - If you delete the cookie after using the product, the user again to access the product, you need to ensure that the product is still to make appropriate treatment, not unexpected action.

Web software test data input checklist details, readers can view the original, but also includes a checklist form input, date input, digital character input. These lists provide a good reference for Web testers design test cases.


Based on the development process of software testing process management

0 Introduction

With the development of the software industry. Software products have been affected in many areas of our society, people increasingly high expectations of software role, gradually increase the awareness of the importance of software quality.

However, the software defect (bug) is associated with software product development process and the perfunctory goods, the use of new technologies and methods, software defects can not be completely eliminated. Therefore, early in the software development process, the introduction of software testing techniques to ensure the quality of the software, to reduce the rate of software defects, has been recognized by the software industry. - A stage in the software development process will produce appropriate documentation and products, rigorous evaluation and testing of these documents and products, early detection of problems. Timely and identify the item does not comply with the requirements analysis and project plan. Software defects early detection, early treatment can greatly reduce the problem of traditional software testing in the molding of the software products, modify the waste of human and material resources problem.

A software defect management

Software defect management tracking software defects found in the software development process management. And record the information of the state of software defects, guarantee the each software defects can be found off. Software defects software development process management is an important part in the project management process. Software testing process management in its essence is a document management software defects, standardization process.

1.1 software defects report

Software defect report (bug report) is the most important document to be submitted in the testing process. The importance of it just as much as the test plan. And greater impact on the quality of the product other than the document output in the testing process. Recorded software bug occurs environment, steps and results to fix errors developers can duplicate reporting bugs, thus facilitating the analysis of the bug causes positioning bug. Therefore, the effective bug report:

(1) to reduce the the secondary defect rate of the development department.

(2) to improve the development of modify defects speed.

(3) improve the credibility of the test department.

(4) enhance the testing and development sector collaboration.

In order to write - a good bug report should follow the following terms:

(1) streamlining: bug report should be clear and brief. The most direct, concise language to describe the most useful and important information.

(2) Accuracy: Make sure each bug reported are valid, verifiable, rather than own understanding, installation, improper operation and other factors bugs.

(3) neutral: objective language to describe the bug. Does not add any personal character language color description.

(4) precision: a clear description of the bug generated steps to ensure that the language is clean, organized.

(5) Positioning: According to the company or industry standard for accurate positioning of the discovery of the bug, and try to use short step to reproduce this bug.

(6) summarized: try to summarize the discovery of the problem.

(7) to reproduce: Check the reported bug can be reproduced. If you can not reproduce, the contingencies of the problem.

(8) Isolation: reported a bug in the bug isolation, environmental information Xieqing bug.

(9) Check: peer review is one of the most effective means of problem.

A 1.2 traditional software testing process

When - a software project to test, go through the test plans, test environment and use case design, implementation, unit testing, integration testing, system testing, assessment tests, and finally given the corresponding test report these a process.

Traditional testing process, although a certain degree of correspondence between the V-development model and software engineering, but the testing process and the development process or two separate processes in the early stage of the software testing process, but a separate plan to do, not software. audit and review of all operations in the development process before coding. The real test is to wait until after the molding of the software product. Before running the test cases. Defects found in the software development cycle, the more late. The cost of repair is higher. Therefore, in order to improve the efficiency of software development, it is necessary to software testing throughout the entire software development process.

2, based on the testing process of the development process

According to the characteristics of the software development process, software development process can be divided into: the project, needs research, outline design, detailed design, coding & unit testing, integration testing, system testing, acceptance testing stages. Then in connection with the various stages of the corresponding test.

In the project of the project, the testing process to synchronize the start, and cover the entire software development process. This requires making the software testing process to consider the documents and products of the various stages of the audit and review of the software development process. Needs assessment document and product at various stages of the testing process.

In the software testing process to consider a review of the various stages of the software development process documentation set. Appropriate assessment or test results, then they would have to document the formation of a new software defect reports or records. Project leader or senior executives through the reading of these documents, you can clearly know the software exists in various stages of development, eliminate software defects able to occur due to pre-design problems in the bud, to ensure the efficiency of software development and software quality . Records and documentation of the various stages of the testing process.

Based on the development process of the software testing process has the following advantages:

(1) are added at various stages of the software development software accreditation and Figure 3 test process test work added to the document and the product review to ensure that the development efficiency of the whole process of software development and software quality.

(2) to get rid of the traditional test processes and development processes are independent of each other, the status of software testing is only responsible for molding software products.

(3) The detailed documentation of the evaluation and test results for the various stages of the software development process. Beneficial project leader or high-level quality checks.

(4) assessment or testing throughout the software development process, can greatly reduce the workload of late testers and developers, conducive to optimize and upgrade the software.

3, Conclusion

Any software development organization would like to completely eliminate software defects are unrealistic and impossible to achieve. In order to develop high-quality software products, in addition to a rigorous development process and development standards. The introduction of software quality assurance throughout the software development process is an effective means. Through the review of documents and products in various stages of the software development process and test, a detailed documentation of the results, is to protect the quality of software products and reduce late workload management solutions. With the continuous expansion of the scale of software, the increasing number of software defects, the advantage of this program will be much more significant.


Talk about the need for performance testing of Internet banking project

Network life over the past decade network technology presents an ever-changing scene, people are more and more rich, especially in the last two years the popularity of the social network service (SNS). Demand for consumer services through a network of concurrent amount has become increasingly evident, software performance testing also will be more and more important.
Applications like "man" word, functional testing is the left write as if people left leg; development and design in the middle position, as if the brain core central; performance test with a flick of the right, like a person's right leg. A need to walk on two legs, step left leg, right leg step, in order to move forward in an upright manner, if the lack of First will be the foot of the slope, and even seat wheelchair dangerous. Software testing is the last "door" is software quality assurance throughout the software development process can not, or the lack of a strong referee. As a test engineer, had also been used in performance testing experience too stupid method, one of the functional modules of the application system performance testing: left hand holding the stopwatch Qiazhao count time, and the right hand controls the mouse to trigger action Now that I think really funny. In recent years, the performance testing across the stage when development is moving in the direction of automation and intelligent. The importance of performance testing highlights the importance, in the banking sector, it is difficult to predict because of the complexity and diversity of the network environment of the banking system (including core and peripheral systems), database environment, application server environment, system platform and technology architecture user load and increasingly complex application software performance is very difficult to control.
Here are two bank case to explain the need for performance testing:
   In early June 2011, XX online banking system shortly after the on-line, the user login failed the exception information network error. Project team responsible for the timely apply to the corporate headquarters for the relevant technical staff, which includes performance testing experts, to quickly build a performance test environment and system performance test of the entire online banking login exception reproduce the problem, senior developer code eleven investigation. Found that the main causes of the problem through performance testing the the password controls above in the third-party company. Password controls in code using a global variable, resulting in abnormal system concurrency visit other users of the system can not properly parse password to login failures. These problems appear in the on-line, although the problem is in the third-party password controls above, but also bring to the company, the project team and customer loss, especially damage to the image of the company, we work in the front of the line to do is not enough. In fact, these issues can before the on-line through the formal performance testing to circumvent, why do not you reflect on it?
Performance test by the vast majority of people think is a simple thing to do, is to take the tools that running ", this is a misunderstanding. Not done performance testing applications, the performance of a non-payment responsibility, with great risk, is not sound. In the bank so complex and diverse environment, even the best software development engineers also can not guarantee that the developed software performance issues. To improve system performance not rely solely on the performance testing can be done, but the performance tests are still effective means of control performance.
So software testing is an important performance testing is the most important, can not be ignored.


Detailed differences and relations between Linux and Unix systems

Differences and connections

Linux and UNIX, the biggest difference is that the former is an open source free software, while the latter is the traditional commercial software implementation of the protection of intellectual property rights to the source code. This should be their biggest difference, that difference is reflected in the user a high degree of autonomy for the former, while the latter can only go to a passive adaptation; This difference is also reflected in the development of the former is in a completely open the environment, and the development of the latter is entirely in a black box, only the developers to be able to contact with the product prototype.

Linux's source to be traced back to the most ancient UNIX. In 1969, Ken Thompson of Bell Laboratories began to idle PDP-7 computer developed a multi-user, multi-tasking operating system. Soon, Dennis Richie joined the project in their joint efforts to the birth of the first UNIX. Richie by an earlier project - MULTICS inspired, this operating system named Unix. The early UNIX is written in assembly language, but the third version of the redesigned with a new programming language C. C Richie design and the programming language used to write the operating system. Through this re-write, Unix can be ported to run on a more powerful DEC PDP-11/45 and 11/70 computer. Subsequent all, as they say, has become a thing of the past. Unix from the laboratory to come out and become a mainstream operating system, and now almost every major computer manufacturer has its own version of Unix.

Linux originated in the simple needs of a student. Of Linus Torvalds, Linux author and the main defenders in college only afford software is the Minix. Minix is ​​similar to Unix, is widely used for auxiliary teaching simple operating system. Linus of the Minix not very satisfied, and decided to write their own software. Familiar with the Unix his student days as a prototype, began his work on an Intel 386 PC. His progress rapidly, encouraged by the achievements, he will be on that success through the Internet to share with other students, mainly used in the academic field. Some people see the software and begin distribution. Whenever a new problem, someone will find a solution immediately and to join them soon, Linux has become an operating system. Is worth noting that Linux does not include the Unix source. It is open POSIX standard rewrite. Linux heavy use by the Cambridge, Massachusetts, the Free Software Foundation's GNU software, while Linux itself is constructed.

Another two major differences:

1) UNIX system most of the supporting hardware, Linux can run on multiple hardware platforms.

2) UNIX is a commercial software, Linux is free software, free, open-source.

UNIX (5 million dollars), while Linux free

[History]

Unix history longer than linux thinking of Linux from Unix

[Products]

are the name of the operating system unix and linux. Unix four letters in addition to the operating system name, but also as a trademark owned by SCO all.

Linux commercialization RedHat Linux, SuSe Linux, slakeware Linux, domestic red flag, and so on, as well as Turbo Linux.

Unix main Sun's Solaris, IBM's AIX, HP's HP-UX, as well as x86 platform SCO Unix / Unixware

Other differences

The linux core was free, free to use, core source code is open. Unix core does not open;

Requirements of the hardware, linux than unix lower, not so harsh unix. Installed on linux unix is ​​easy to grasp.

Use linux relatively no unix so complicated.

Unix majority is hardware vendors for their own hardware platform's operating system, such as the CPU, such as Sun's Solaris as commercial, positioned on its use of the SPARC / SPARCII the CPU workstations and servers, of course Solaris also have an x86 version, while the Linux also has its version of RISC. However, exact comparison is not appropriate to take the Linux Unix on RISC and x86. As for prices, personal use Linux basically be free, different Linux distribution vendors on some of the basic system optimization for enterprise-class applications, such as RedHat's Enterprise products, which include support services are more expensive. Like IBM / HP / SUN Unix, for its hardware platform, operating system, usually in the price of the equipment. (Alone buy a Unix operating system)

Performance, linux no unix less comprehensive, but basically is more than enough for individual users and small applications.

Under normal circumstances, if you have the opportunity to use the Unix environment, such as banks, telecom sector, that are generally fixed models of Unix. Such as telecommunications SUN majority, the majority of civil aviation in the HP bank IBM's majority. Learning, different Unix command set is somewhat different, pay attention. As for learning, I think, or linux compare studious, and now more and more people like to tinker with linux, various linux. If you want to learn Linux or BSD system is a good choice. A x86 machine can.

On the application, unless large sites, general corporate or personal use Linux can.

UNIX is a powerful, comprehensive performance multi-user, multitasking operating system, can be applied from supercomputers to ordinary PC, a variety of different platforms, the most widespread application, the operating system has the greatest influence.

Linux is the same or better a look and performance with the UNIX operating system, but Linux does not originate from any version of UNIX source code is not UNIX, but a UNIX-like products. Linux products successful imitation of the UNIX system and function, specifically Linux is a compatible with the System V and BSD UNIX operating system for System V source code of software programs to get recompile under Linux can run For BSD UNIX executable files can be directly run in a Linux environment.

Generally speaking, Linux is set to comply with POSIX (Portable Operating System Environment) specification operating system in an ordinary PC computer, it is able to realize all UNIX features, has a multi-tasking, multi-user capabilities. Another major source Linux loved by the majority of computer enthusiasts, it has the full functionality of UNIX, any use of the UNIX operating system, or want to learn UNIX operating system can benefit from Linux.

Network management capabilities and security, the use of Linux people are very similar to the recognition of Linux and UNIX.

UNIX system has been used as a high-end application or server systems, and therefore has a comprehensive network management mechanisms and rules, Linux follows the excellent rule, the network configurable ability for system management provides a great flexibility.


Some practical contradictions of the reality of project management

1, the lack of testing resources and software quality assurance contradictions

No available test team or testers widespread problem of inadequate testing resources in many small development teams and small companies, and even in some large companies may also occur. Strict cost control, resulting in relatively enough testing resources; the failed project development plan will result in compression test of time to ensure that the research and development time; to the test of time, it certainly appears that you are such a situation. The final result of it all had not: leadership because of customer complaints and headache even scolded by the boss; Quality primary responsibility of the project manager will have primary responsibility for the entire project. If the test team, the quality control of the test will have primary responsibility. No, the primary responsibility of the project manager.

Responses to the following: let developers do the test; allow a limited number of testers to test the core function point only; project manager to carry the dead, own hands; reduce software quality; leadership is fully aware of this contradiction risk.

2, the project schedule abnormal urgent and time on the line contradictions

The biggest problem is the time cost of such projects. Time costs more tightly, the greater the risk of failure. To improve the survival probability of such a project, there is only one way. Cut range. The of all dispensable demand cut on the next issue to be realized. Ensure that the team to reasonable productivity output results. Project manager to do the most important thing is to leave no stone unturned, the low-priority function cut. Focus our resources to ensure that the output of the high-priority needs. Understand the maximum output of the customers, team, and the team is doing what features you want at any time tell. In a timely manner so that customers confirm and adjust. Let the customers understand how risk where. This is a test project manager communication, negotiation, organization and coordination skills. Can customers bite down, to ensure that the team is working properly, there may be living in the 1,2 points. Otherwise, the last on a scapegoat. The team, the boss, the customer, all you need to take responsibility.

3 team productivity seriously below the estimates and the project on time and on line conflicts

The bidding of the project is a project to estimate when and quoted by the company's senior architect of the Group in accordance with existing productivity, but after the start of the project, the problem of a lack of resources, such as: the original C + + team of experienced engineers emptied, only two new available. The former Senior C + + Developer productivity of engineers to estimate the time, such a team to give you productivity and Senior C + + development engineers a lot of difference. The project schedule is unusually urgent, how to do this? No way. The risk of failure of this project is extremely high. Solution only to find foreign aid or project manager to carry the dead, or the type of project failure is inevitable. Team members suddenly left a great risk of the project, especially the core of experienced developers, often at the cost reasons, can not everyone have a backup personnel, so the core of experienced developers suddenly left to tend to make the project is in a high-risk status.

4, project managers act as the Team Leader contradictions

Two posts of Project Manager and Team leader looks like, in fact. The project manager's responsibilities include: project schedule control, cost control, demand control, risk management, configuration management, task allocation, and communication and exchange with customers. Team leader of the main responsibilities include technical program confirmed that development planning and tracking, technical architecture design, important technical issues research, the core code writing and technical guidance and the development team management. For small companies, in order to save costs is likely the two roles for a person to assume this mixed role requires a very high capacity of individuals need the expertise of both, the two had first-hand grasp, a lot of pressure. Many large companies are basically split these two roles, the project manager is the tube progress, do coordination, Team Leader, responsible for the development of related matters, in addition to a role called Product Manager, this role is to market and development before do coordination. As I understand it, the project manager needs to have a very in-depth understanding of project functions and requirements (product), considerable experience in the software development process, but also has a strong ability to communicate, because customers are cattle mess, you want to guide customers needs, communicate martial artists. In addition, the project manager is the total person in charge of the project, the leadership of timely communication and coordination across projects and departments also need to get the best resources to solve the problems in the process. Team leader needs to control systemic risk in the development process, the overall architecture and key core part of the development. There are many aspects of the software development process, a part of any large error will result in bruised and battered and ultimately project failure. But in most companies, we do not call it fails, the general would say: project delays, good extension of six months, the poor and even some 1-year extension Core competencies: development and management + strong technical capabilities.

5, limited resources and time and time on contradictions

Project management is how the main contradiction in the limited cost (resources) and quality time to complete the system. The hair * Ze (East ideological revolution is successful, to be able to distinguish between the various stages of the revolution principal contradiction, concentrate superior forces to be combated in time management is the severity / urgency severity, that is, whether the core needs; priorities, namely priority class, order. limited resources, then the core resources on core functions and components of greatest risk I remember those years, his work would never consider such issues, leadership let Zuosa on Zuosa passive positive (with on the go all of the tasks, no task on the self-study, indifferent) time I'm just a performer. fact, anything can be divided into two phases: first assigned, and then perform the (daily life, we do anything are first assigned in mind). while in the company, these two things are often separated: the leadership to do the assigned subordinates do perform.

The core principles of the allocation of tasks is to prioritize, as a manager, it must take it a habit.


2013/03/25

A Chinese famous enterprises then test cattle

Know that Google TE fewer people, because the research and development of early defect prevention and detection do enough, in addition to a variety of tests to build a good foundation, the RD design and code quality high graves and or test execution resources, so without much TE. But later want to add the TE, should be aware of existing quality assurance processes and the ability to model the existence of loopholes in the release part not handle, only to change their view to how much pressure people to change values


Under Linux installation, start the MySQL

Three or four years is not installed mysql + apache + php environment, I used to do the the bank performance test outsourcing services in the the Party Development Center encountered such environment project is relatively small, mostly WebLogic / WebSphere + Oracle/DB2 architecture of large-scale systems. Get involved in the electricity supplier industry project, had to go to ponder those almost forgotten IIS, apache, MSsql, mysql environment.

An virtual centos4.7 of the platform: VMware

Host: windows

Install mysql preparation:

1, check whether the environment has been installed mysql, check: netstat-ano command to view the mysql port 3306 by default exists; execute mysql command line

2, download mysql installation package

Http://www.mysql.com/downloads/mysql/ # downloads download mysql installation package:

MySQL-server-5.5.28-1.linux2.6.i386.rpm

MySQL-client-5.5.28-1.linux2.6.i386.rpm

Rpm-ivh command to install mysql not say it here.

First take a look at some of the main directory of the default mysql database:

Database directory / var / lib / mysql /

2, the configuration file / usr / share / mysql (of the mysql.server command and configuration files)

Related command / usr / bin (mysqladmin mysqldump command)

4, the startup script / etc / rc.d / init.d / (startup script file mysql directory)

Default port 3306 netstat-ano command to view installed mysql start mysql service if it does not exist, according to the following method.

Start mysql service:


[Root @ localhostmysql] # pwd
/ Usr / share / mysql
[Root @ localhostmysql] #. / Mysql.server start
StartingMySQL ... [OK]
[Root @ localhostmysql] # netstat-ano
ActiveInternet connections (servers and established)
ProtoRecv-Q Send-Q Local Address Foreign Address State Timer
tcp 0 0 0.0.0.0:3306 0.0.0.0: * LISTEN off (0.00/0/0)
[Root @ localhostmysql] # mysql
Welcometo the MySQL monitor. Commands end with; or \ g.
YourMySQL connection id is 1
Serverversion: 5.5.28 MySQL Community Server (GPL)
Copyright (c) 2000, 2012, Oracle and / or its affiliates. All rights reserved.
Oracle isa registered trademark of Oracle Corporation and / or its
affiliates.Other names may be trademarks of their respective
owners.
Type'help; 'or' \ h 'for help. Type' \ c 'to clear the current input statement.
mysql>
mysql>

Start and stop

1 to start
Mysql MySQL installation is complete, start-up file in the / etc / init.d directory, run the following command in the need to start.

[Root @ localhost mysql] # / etc / init.d / mysql start
2, stop

[Root @ localhost mysql] # / usr / bin / mysqladmin-u root-p shutdown
3, automatic start

1) back to mysql automatically start list

[Root @ localhost mysql] # / sbin / chkconfig-list
2) MySQL add to your system startup services group inside to

[Root @ localhost mysql] # / sbin / chkconfig - add mysql
3) to remove the MySQL service group from the start inside.

[Root @ localhost mysql] # / sbin / chkconfig - del mysql


About the the performance test tesseract-ocr tools to identify some of the ideas in the verification code

About the the performance test tesseract-ocr tools to identify some of the ideas in the verification code
The last week, I engaged in the verification code, fortunately tesseract-ocr tools can identify the characters stored in the local picture, is to take advantage of this, a lot of friends this function is used in the identification verification code (some verification code can not be identified, the accuracy is not high, it may hinder the identification to verify the presence of noise in the code). I is just copy or imitate the, solve the problem of the LoadRunner identify verification code, all C-based environments. Can see my blog post: http://www.cnblogs.com/zhuque/archive/2013/03/06/2946565.html


Tesseract-ocr tools for some verification code recognition accuracy is not too high, and even some picture identification simply does not come out, it is recommended that formal stress tests, do not use this method to solve the problem of verification code, the better approach is in code to solve, or using a universal verification code. Another method is the the login transaction code (involving verification code code) into vuser_init () to that after a successful login, the frequent pressure measured behind the transaction. But there are many transactions of the type of operation and verification code, such as: the payment of this you must use a universal verification code.


Do not tangle in the performance testing process verification code, after all, more than 98% of the performance test are specialized independent test environment can modify the code to solve the verification code problems, there are many ways. But does not rule out some metamorphosis the CTO or customer requirements online environment pressure measured, we can try to tesseract-ocr recognition verification code, if you can not identify, and then to try to remove the noise in the captcha identification. How to remove captcha the noise go after study, evidently, this is a big project.


LoadRunner using the system () function call Tesseract-OCR recognition verification code script code

Here is loadrunner script: C disk Establish test.bat batch:
Action ()
{
    int flen; / / define an integer variable to hold the size of the file
    long filedes; / / save the file handle
    char file [256] = "c: \ \ test1.jpg"; / / save the file path and file name
    char result [10]; / / store verification code

    web_set_max_html_param_len ("2000000") ;
/ / set the page to receive the maximum number of bytes, the setting should be greater than the download file size

         web_reg_save_param ("pic",
                   "LB =",
                   "RB =",
                   "Ord = 1",
                   "Search = Body",
                   LAST);

         web_url ("randpiccloud", "URL = https://passport.csdn.net/ajax/verifyhandler.ashx?r_d=63178", LAST);

         / / Http://biz.ftuan.com/CheckImg.aspx
         / / Http://passport.ftuan.com/SecurityCode.aspx?refresh=Wed Mar 6 11:21:21 UTC +0800 2013
         / / Http://comment8.mydrivers.com/radompage.aspx?0. {Rnum}
         / / Https://passport.gaopeng.com/captcha?w=98&h=36&r=0.4655476964544505
         / / Https://passport.csdn.net/ajax/verifyhandler.ashx?r_d=63178

    
    flen = web_get_int_property (HTTP_INFO_DOWNLOAD_SIZE); / / get file size

    if (flen> 0)
    {
        if ((filedes = fopen (file, "wb")) == NULL)
        {
            lr_output_message ("oh cloud your Open File Failed!");
            return -1;
        }
        fwrite (lr_eval_string ("{pic}"), flen, 1, filedes);

        fclose (filedes);
    }


       system ("c: \ \ test.bat");
       / / Call the C drive under test.bat file, change the file as follows:
       / *
        c:
        cd C: \ Program Files \ Tesseract-OCR
        tesseract.exe c: \ test1.jpg c: \ test-l
       * /
       / / First, download the the Tesseract tools and installation, must cd to the installation directory in a batch file, or LR called the prompt "tesseract.exe than internal command"

       if ((filedes = fopen ("c: \ \ test.txt", "rt")) == NULL)
        {
            lr_output_message ("oh, cloud your Open File Failed!");
            return -1;
        }
        fread (result, 5,1, filedes); / / here to control the length of the verification code
        fclose (filedes);

         lr_output_message ("result:% s", result);
lr_save_string (result, "txtCheck"); / / pass validation code to txtCheck parameters
lr_output_message ("txtCheck:% s", lr_eval_string ("{txtCheck}")); / / lr_eval_string ("{txtCheck}") used in the following registry
return 0;
}


Full-width and half-width of the difference between input method

A What is the full-width and half-width?
(1) angle - a character occupies two standard character position.
Kanji characters and provides for the full-width English characters and the national standard GB2312-80 graphic symbols and special characters are full-width characters. The general command of the system do not have the full-width characters, just word processing will use the full-width characters.

(2) half-width - refers to the position occupied by a character of a standard character.
Usually letters of the alphabet, numeric keys, symbol keys are half-width, within a half-width of the display code is a byte. Within the system, these three characters are handled as a basic code, so the user input commands and parameters generally use half-width.

B full-width and half-width of each in what circumstances?
The full-width accounted for two-byte, half-width of one byte.
The half-width full-width punctuation, full-width punctuation accounted for two-byte, half-width of one byte, regardless of the half-width or full-width, Chinese characters, or to account for the two bytes.
Only in the source code of the programmed use of the half-width punctuation (excluding internal data string)
(In fact, this case simply does not exist the concept of full-width of the half-width on a computer that does not support Chinese characters and other languages ​​can only use half punctuate)

For most fonts, full angle looks larger than the half-width, of course this is not the essential difference.

C full-width and half-width of the difference between
The full-width is the width of letters and numbers, such as Chinese characters accounted position word. Half-width ASCII character way to do with the time from the Chinese character input method input alphanumeric characters are half-width.

Appear in the Chinese character input method, input alphanumeric default to half-width, but the punctuation is the default for the whole angle corresponding toolbar button mouse click input method.

D "full" and "half-width":
The whole angle: means in GB2312-80 (information exchange · basic set of Chinese ideograms coded character set ") in a variety of symbols.
Half-width: refers to the various symbols of the ASCII code of the English document.



Software testing methods and rules

Hump ​​naming rules: first letter lowercase, followed by the beginning of each word uppercase money (java all the methods and properties named in camel)

Pascal naming convention: the first letter capitalized, behind the beginning of each word uppercase Money (C # inside classes, methods, properties, java inside class named)

The variable type character dMoney Hungarian rule: the basis of Pascal naming rules, plus a lowercase

static: static belong to the class of all owners do not need to instantiate, only a small memory consumption during the execution of a program in memory assigned space

Non-static: have to belong to the object, you need to instantiate

Person p = new Person ();
Person p1 = new Person ();

Write a police class, there is a method of training and duty, a police officer the name of an attribute of police officers a property number, write a test class
Assignment by the police number and name call training and duty
JAVA inside strict case-sensitive
public-modified class, the class name and the file name must be exactly the same

Singleton Pattern
If a class constructor is private, outside the class can not directly call the constructor to create methods
Outside the class and can not by the object. Way to call

When a class can not be instantiated, we can only call it what method? Can only call the static method

Class class name {
   Private constructor

   Static public method static
        Only such internal call a private constructor and the instance should return out, returned instance must be a member variable
}

Thread safety issues? For inside the static method to instantiate this variable may still exist, when multiple threads at the same time to get the object, creating multiple objects

The simplest single cases of how to achieve

public class PoliceMan {
   / / Constructor private
   private PoliceMan () {
   }

   / / Member variables private, static, static code is executed only once
   private static PoliceMan onePolice = new PoliceMan ();
   / / Static method Total, returns an instance of the private member variables
   public static PoliceMan getInstance () {
      return onePolice;
   }
}

The UNIT TEST unit test in Visual Studio


TDD (Test-Driven Development) test-driven development is a core agile development practices and technologies, is also a kind of design methodology. The principle of TDD is the first writing unit test cases before development function code, code, test code to determine what you need to write the product code. Unit testing is the most basic test steps. Located in the very bottom of the V-model of the entire product development process.
Approximately as in various development processes RA & PSD is complete without the underlying foundation, UAT program to complete the following steps. UT as the bottom and CODING equally important step is the basis of each CODER must master.

RA( Requirement Analysis)  &
PSD ( Productive Specification Design)              UAT( User Acceptance Testing)
                          \                                                              /
                            \                                                          /
                              \                                                      /
FSD(Functional Specification Design)             SIT(System Integration Testing)
                                \                                                 /
                                  \                                             /
                                    \                                         /
                           Construction(Coding)         UT(Unit Tesing)
                                         \                              /
                                            \                         /
                                                \                   /
                                                  \              /
                                                     \         /
                                                        \    /
                                                          \/

Create a new console project (Console Application) in the small amount of code to write, often by New Web Site Project (Web Form), in which typing test code to test. Once the amount of code and logical relations are complicated, this test will be difficult to carry out, and do not have the maintainability. And many functional code can not be completely divorced from the entire project. Such as a class library in a web project, write some MODEL layer To test the method, in order to verify the correctness of the method may have reference to the project model, interface, and library functions. Wait until the can by the compiler, but found you must be logged in to call the method or your directory (Directory) does not have the access rights, so he had to modify the Authorization configuration or add a login method. So layers down your test project involving almost every corner of the test program without a high degree of reusability.
Here we VS2012 example, look at how unit tests in Visual Studio.


1, right-click the solution (Solution) to pop up the context menu (Context). Select Add (Add) - a new project (New Project), in a given template, select Visual C # - Test-Unit Test Project As.

2. Template As.
3.The test method (here the default TestMethod1, general amended as the need to test the method name + Test) add the need to test their own code. But before this, we must first reference to the need to test the project as well as the need to use the class library. In this example, I quote Microsoft MVC4.0 framework, as well as the need to test the project Controller. I test the the Controller ProductCategories () method. The method returns a The ActionResult. 3 lines of test code, the first line to a instantiate the controller, the second line calls the controller method. If only the 2 line test is passed, then the code without problems of syntax, and other parts work together. The third row with an assertion to detect method returns the result is empty. Here I assert that it is not empty, an error if it is empty, the test will fail.
4,The test code is written, you can click on the the above menu Test-Run-AllTests, to carry out the test.。
After the test is completed. Below will produce a list of results. Red for failed TestCase. If you want to be the DEBUG Right-click the red TestCase, select Debug selected Tests. Modifications, can also right-click you want to re-test TestCase, select Run the Selected Tests.

2013/03/24

Control of the entire page cache and update dynamic pages as static pages




Static pages we all know, WEB server sends back the contents of the file comes with a Last-Modified header information, and static files last modification time stored inside, so that when the next time the browser requests the file will get Last -Modified header information exists with the If-Modified-Since sent to the server, telling the server's local cache last modification time, will first determine the end of the file when the server receives the time information of the If-Modified-Since request modify the time is later than this time, the late update, will retransmission of the contents of the file, along with the latest Last-Modified header information to the client, if the time is equal to or more than this time early, it shows no update cache fully synchronized, it will send back a 304 Not Modified status code, and to stop retransmission file content, and can save unnecessary data transmission.
Above is a static page cache and update the control mechanism, generally all this is by the WEB server directly arranged deal, all without user intervention. Dynamic pages are not so lucky, because of the dynamic page requests are forwarded by the WEB server to a specific page handler to complete their cache and update the strategic issues, and not arranged, so these controls must programmers to complete. Unfortunately, however, the dynamic page handler is unable to automatically handle cache is a whole page-level cache, we can cache a variable in the code so that at the next call, but still a lot of code to be executed, they can as static pages to the client a Last-Modified header information, determine the time and data updated when the next request, in order to decide whether to repeat the process and send data?

From the above analysis it is entirely feasible, but it needs to do special processing script, which is a logic to regulate this update detection, of course, this is not the focus on this. Because the the client to accept last modified time to completely rely on the Last-Modified header information, so dynamic scripting can be sent back to the content is also output a time as a basis to judge, then the next time the client requests the same page (accurately, should with a URL address), Last-Modified header information received will be appended to the If-Modified-Since request over. To a dynamic page here, we can get included with the request last modify time, then the first judgment point in time whether there is a new deal with the data, there is no new data, then, we are on the direct end of the current script, you can save server resources. Of course, before the end of the script, you need to play a 304 status code, because let clients sure to use the cache, must also be dependent on the status code, so just use dynamic script sends back a 304 Not Modified header information can not only saving server script execution resources, but also save the flow can be described as killing two birds with one stone, and the application form is more flexible and more controllable.


How to speed up the pages open faster?



Recently saw a question on how to quickly open the site, I briefly summarize the impact website open speed 3 reasons (the question of the physical line that is unable to avoid random problems can not be solved).

The client browser is the most direct impact label rendering speed involve speed, CSS rendering speed, scripts, and dynamic function of the amount of resource consumption. The label different rendering speed different, why people like DIV + CSS layout, form rendering in the number of nested multi slow, because the table is the basis of the framework, but rendering when he needs to first total size and the size of each cell is calculated based on the contents of the table cell, and then began to render, so the speed will be slower. Like a stage curtain, we always first curtain pulled down, and then wait for after the actor came to power to adjust the position until their positions before we pull opening, so that the actor lineup once to show to the audience, but the audience face monotonous curtain waiting long time. So to minimize the use of rendering slow the label, and as far as possible the direct definition of label size, rendering computation time savings. Then there are some very important CSS or filter function expression evaluates to try to ensure that in the case of less resource consumption, the script of this principle, and save resources.

2 network at the same time the number of concurrent to reduce, and as far as possible to reduce the amount of time transmission of data. Small icon file, can be taken in the form of merger into a larger image, once direct re-completed, then the client is displayed using CSS positioning cuts part of the need to show up, thereby reducing the number of simultaneous requests. Reduce the amount of data, such as take CSS overall definition the rendering style, try not specific to each label style set, you can save a lot of code. Such as data transmission using JSON way, will save a lot of code than XML, in a page, and try not to additional references never use JS script, some large-scale repetitive regularity label rendering try using JS code to complete, more codes can be saved, and in short, the fundamental principle is to use as little as possible the amount of data to transmit as much information as possible.

3, the server is the design of the program, to avoid logic errors caused infinite loop like resources occupied, try not handle cases promptly shut down, in order to avoid unnecessary idle resources occupied wasted This is relatively simple, here is not to expand that.


IIS hidden folder can not be applied to the default Home


Configured IIS site, in order to prevent the home directory of the user accidentally deleted ASP script, deliberately set the directory hidden attribute, access to the directory hierarchy results prompted 404 error, I thought insufficient permissions to the folder, modify the permissions improve IISaccount permissions to modify the default home once again. The result was 404, obviously Home in there why not find it? Home and assigned to a specific file name, the page is normal, normal access can not find is the default home page. Then suddenly think, is not a folder hidden attribute result, so quickly unhide property, now no problem.
It seems windows folder attributes IIS still has some influence.


Interaction type page to prevent IP spoofing techniques



Many interactive web pages, such as online voting, online answer, online surveys and online sweepstakes, in general, will be the user's IP as restrictions, limiting the number of users to participate in activities of the same IP.

        Network popular with many of the so-called take real client IP code, nothing less than the origin are by checking the agency to obtain the so-called "real IP, but the IP is really" real "? I do not think such practices seem to have some smart anti cleverness.

        As we all know, web access protocol is HTTP, the communication process in this agreement, almost no credible data. The reason I say that is because all of the HTTP protocol data are forged, and the only real request page direct client IP. This IP REMOTE_ADDR to get through the HTTP environment variable, which can be said is the only credible address data, while the other two environment variables HTTP_CLIENT_IP HTTP_X_FORWARDED_FOR indicates proxy source path IP, but unfortunately, these data are not reliable, unless you are sure that the proxy server is reliable, but this is almost impossible.

        Here, in the end how to obtain more reliable client IP before, my point is REMOTE_ADDR to the direct request of the IP source, because it is the only reliable data. If we trust In addition, two proxy server IP information using the so-called popular on the network to take a real IP? The result is very bad, we will easily be hackers forged proxy antecedents IP, then maxed out the results of our voting data.

        So, when the need to determine and limit IP, do not consider the so-called proxy IP, those are clouds, there is no reliable information to prevent IP spoofing fly can only rely on the detection of direct access to the address.




Instead of cumbersome inefficient use of PHP5's __autoload the external file containing the way

Generally written PHP code comrades, may file contains commands include, include_once, require, require_once familiar. Although these commands has played an important role for us to re-use the same code, but as the file be included, as well as the interaction between the include file contains the entire PHP application contains relations intricate. And there is a very inefficient, we write a PHP page may have to go hand-written code contains external public documents to be used eleven, and once the project becomes huge, modify the include file references will become a headache, because we must first know where references an external file, we can modify. Fortunately, with the release of PHP5 to a new function __ autoload entrance parameter is the name of the class is not defined. If we declare this function in your own code, it will be called automatically when you attempt to use the class has not yet been defined. By calling this function the scripting engine in PHP error class load required given a last chance before the failure. Here we should be able to think of, we can take advantage of this new feature, coupled with the use of object-oriented programming, we need to refer to external public code are encapsulated into a class inside the storage to the same as the class name file to the automatic loading function is triggered, we can directly contain PHP file with the name of the class, you can achieve the dynamic loading of external files. So we write code, you do not need to advance include external files, but also to achieve the object-oriented programming model, a page to the introduction of new classes only need to directly instantiate the class can, PHP accordance with __autoload the definition automatically go call the external file. Modifications and extensions is easy, as long as we have the class definition and maintenance on it. And even called among multiple classes and instances, without first contains the introduction, as long as the main code __autoload function declaration and the class definition file storage is handled in strict accordance with the rules, then calling each other between classes. and instantiation will auto-complete, which we will be able to rid itself of the original kind of cumbersome and inefficient external file contains way. Now I give you a simple piece of sample code, as long as the definition of a good external class file naming and storage rules, can facilitate the use of this fully automated external file contains. say ();  ?>      / / Inc / demo.php class definition example  

ruby + watir - random rather than obtain duplicate the Menu menu of elements

Test case: using a loop, random to get nine Menu menu, each must click and verify: def channel @b.goto URL channel = 0 while channel <= 8 times = rand(9).to_s AutoTest("channel_#{times}_link").click sleep 1 assert_true(AutoTest("channel_#{times}_link_on").exists?) channel += 1 end end Cycle nine times in the script, to take a random value every time, random number rand () is 0, so I element defines 0 of these nine elements of the Menu menu coding, such as: channel_0_link. But there is a problem rand () function take duplicate values​​, that some Menu menu click on 2 or more times, which our barge. I almost hunted API is not found without repeated sequentially or randomly. Next, I decided to use another random method to solve, in fact, random play is divided into two types, random and shuffle。 def channel_food @b.goto URL linkid=[0,1,2,3,4,5,6,7,8] linkid.shuffle.each{ |i| times = i AutoTest("channel_#{times}_link").click sleep 1 assert_true(AutoTest("channel_#{times}_link_on").exists?) } end The above code, can achieve randomized to get nine Menu menu, each must click and verify demand. each method is to get the data from the array; shuffle method to obtain the value of the re-arranged to use this method to do the shuffle program (does not generate repeat). a=[1,2,3,4,5,6,7,8,9] a.shuffle.each{ |i| b = i puts b }