background preloader

Spike Source

Spike Source

PHPLint Current version: 2.0_20140331 PHPLint is a validator and documentator for PHP 4 and PHP 5 programs. PHPLint extends the PHP language through transparent meta-code that can drive the parser to a even more strict check of the source. PHPLint is not simply a checker: it implements a new, strong typed, language implemented over the PHP language. You can build your programs from scratch with PHPLint in mind, or you can check and fix existing programs, or you can follow the quick-and-dirty PHP programming way and then add the PHPLint meta-code later once the program is finished. A new 2.0 version of PHPLint, completely rewritten from scratch, is nearly complete. Documentation: FeaturesTutorialReference ManualSupport for phpDocumentorDocumentator Reference ManualFAQ (Frequently Asked Questions)License Libraries Browse all the PHP modules and the PHPLint standard library of packages. PHPLint on-line The WEB version of PHPLint. UPattern class evaluator Bugs, missing features and to-do list

Web Application Security phpCallGraph - A Static Call Graph Generator for PHP Testing Replication Over the Pond – Part 2 Secure - Everything MySQL Testing Secure Replication For the first test I used encrypted (SSL) replication and inserted 200,000 records using three 10 minute disconnection intervals per hour. After several hundred thousand of inserts, deletes and updates on the SOA and RR tables simultaneously over a normally connected SSL replication channel I have the following results: RR Update TestTest 1: RR Records Updated (Changes Set) = 129145 Elapsed Time = 14147.411601 RR Updates/Second = 9.13 RR Updates/Minute = 547.8 Europe MySQL Slave RR Update Counts (Changes Set) = 129145 Asia MySQL Slave RR Update Counts (Changes Set) = 129145Test 2: RR Records Updated (Changes Cleared) = 129145 Elapsed Time = 10168.638867 RR Updates/Second = 12.70 RR Updates/Minute = 762 Europe MySQL Slave RR Update Counts (Changes Cleared) = 129145 Asia MySQL Slave RR Update Counts (Changes Cleared) = 129145 Below is a snapshot of the transfer results after the Slaves are reconnected to the Master over the given SSL channels:

Track your dependencies with PHP_Depend - Manuel Pichler To provide a flexible and extendable software, it is a good OO practice to reduce the dependencies between implementing classes. This could be achieved by developing against abstractions which means both, abstract classes and interfaces. By using abstractions instead of real implementation in the application you provide some sort of contract, that could be used by others to hook into the application with their own classes that fulfill the contract. PHP_Depend is an adaption of the established Java development tool JDepend. PHP_Depend calculates the following metrics by counting classes, interfaces and dependencies. Ca - Afferent Couplings: The number of other packages that depend upon classes within this package. Ce - Efferent Couplings: The number of other packages that classes from this package depend upon. I - Instability: A - Abstractness: Because in a project not each package can achieve the optimal values of A = 1, I = 0 or A = 0, I = 1, we draw a diagonal between the two corners.

Testing Replication Over the Pond - Part 1 Non-Secure - Everything MySQL Testing Non-Secure Replication A series of experiments were conducted to determine whether MySQL replication would prove to be reliable with SSL enabled. Please note that all tests were conducted using the MyDNS schema with includes the SOA and RR tables on MySQL 5.1. The first experiment sets focused on replication operations and not on a predetermined set of Insert, Update or Delete patterns. So Inserts were used since they are the easiest to tag and verify. Again, the focus is on replication channel fault recovery. Later iterations used simultaneous Inserts, Deletes and Updates against both SOA and RR tables from production snapshots of the mydns database, with request sets greater than 100,000 rows each, over an SSL replication channel. The first test was done by closing the Slave server's outbound SQL port to the Master with iptables, the Slave was uaware it was no longer connected to the Master after several minutes beyond closing.

troelskn/php-tracer-weaver - GitHub Questions about JUnit Can You Write a JUnit Test Case Class in 2 Minutes? JUnit Questions and Answers (Continued from previous question...) Can You Write a JUnit Test Case Class in 2 Minutes? With the simple class, Calc.java, listed in the previous question, you should be able to write a simple JUnit test case class within 2 minutess. package com.parcelhouse.myproj; import junit.framework.TestCase; import com.parcelhouse.myproj.Calc; //testing class public class CalcTest extends TestCase { Calc c = null; public CalcTest(String name) { super(name); } protected void setUp() throws Exception { super.setUp(); c = new Calc(); } /* * Test method for 'Calc.add(int, int)' */ public void testAdd() { int x = c.add(5,6); assertEquals(11, x); } /* * Test method for 'Calc.multiply(int, int)' */ public void testMultiply() { int x = c.multiply(5,6); assertEquals(30, x); } public static void main(String[] args) { junit.textui.TestRunner.run(CalcTest.class); } } This test case class contains two tests: Other Interview Questions

Xdebug - Debugger and Profiler Tool for PHP Faster apps for a faster web: introducing Speed Tracer Do you ever wonder what's going on inside the browser when a webpage doesn't load or respond as quickly as it should? Many developers do, especially when trying to build powerful web applications for their users. But up until now, it's been difficult for developers to identify problems in a slow-to-respond application. So, tonight at Google Campfire One, we're happy to announce that we're adding a new tool to Google Web Toolkit called Speed Tracer. Speed Tracer is a Google Chrome extension that enables developers to identify performance problems in their web apps using a "Sluggishness Graph," in combination with many other metrics. If the y-axis is close to zero, then the app is fastIf the y-axis registers around 100%, then the app is, well, sluggishAnd in either case, Speed Tracer provides lots of additional data to help diagnose any particular performance issue. We think developers will find that Speed Tracer looks under the covers of web applications like never before.

Best FireFox Addons to Analyze Page Load Time Keeping track of your site page load time is essential because it effects both the user experience and the crawl rate. This post lists 3 most useful FireFox addons that will help you analyze web page load time as you browse: YSlow YSlow is the official Yahoo! Google’s Page Speed Page Speed is a Firefox/Firebug add-on that performs several tests on a site’s web server configuration and front-end code. Webmasters who run Page Speed on their pages get a set of scores for each page, as well as helpful suggestions on how to improve its performance. It adds an extra tab to Firebug that allows to analyze current page speed: LORI (Life-of-Request Info) LORI (Life-of-Request Info) is an advanced FireFox addon that adds a status bar at the bottom right corner of Firefox and displaying: Note: it looks like it is not compatible with current FireFox version but it is a classic tool for page load time analysis so I couldn’t help mentioning it.

Examples of Exploratory Testing See lecture notes on exploratory testing and paired exploratory testing. Copyright (c) Cem Kaner, 2004 The essence of exploratory testing is that you learn while you test, and you design your tests based on what you are learning. One definition (Bach's) is “Any testing to the extent that the tester actively controls the design of the tests as those tests are performed and uses information gained while testing to design new and better tests.” Another definition (Bach/Kaner) is any testing process that involves simulteous learning, test design, and test execution. The examples below only scratch the surface of the exploratory process, because they show an easily-understood sequence of test / result / follow-up test / result and so on. Any type of test can be designed and/or used in an exploratory way. The following examples illustrate the application of the function testing style of analysis. Copyright (c) Cem Kaner 2004

Related: