COTS (Commercial Off The Shelf)
Abstract. One of the least tested portions of software systems is error and exception handling. It also most critical situation for software. Error exception handling routines are the safety net for any system to handle unexpected circumstances such as when operating system OS or hardware failures occur. As more critical systems are developed from commercial of the shelf COTS software the robust ness of these applications to perating system failures and in general to failures from third party software becomes increasingly critical. I try to present an approach and tool for assessing the robustness of COTS applications to failures from OS functions or other third-party COTS software. The approach con sists of wrapping executable pplication software with an instrumentation layer that can capture record perturb and question all interactions with the operating system. The wrapper is used to return error codes and exceptions from calls to operating system functions. The efect of the failure from the OS call is then assessed. If the application crashes under these anomalous conditions, the application is determined to be non robust to a particular failing OS call. A failure simulation tool has been developed for testing the robustness of Win32 applications to these types of anomalous OS conditions.
What is Dependency Injection
Dependency injection is an approach to use external reference without any dependency. Each project has several modules that referenced with each other. When developer changes something ( even if atomic changes), all project will be affected with them and some problems will be occurred. So we want to remove dependency from each other.Let’s learn it with this example.
public interface UserDao {
boolean login(String username, String password);
}
public class UserDaoImpl implements UserDao {
@Override
public boolean login(String username, String password) {
return ( username.equals("test") && password.equals("test"));
}
}
How we use this. Here:
public class TestApplication {
public static void main(String[] args) {
UserDao user = new UserDaoImpl();
boolean isLogin = user.login("demo","password");
}
}
It is not important what we wrote at implementation. So we can write test objects easily. This approach is manual DI. There are several frameworks. Spring is one of them.Here is a configuration file and main class.
public class TestApplication {
public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext(
"META-INF/beans.xml");
BeanFactory factory = context;
UsrDao user = (UserDao) factory.getBean("userDao");
boolean isLogin = user.login("demo","password");
}
}
About the IOC then, I’ll write more.
Installing Java on Ubuntu
If your operating system is Ubuntu ( any version), you need to install java in order to run java based application and applets. There are a few way to do it. First of all, you sure if these repo was added in yoru /etc/apt/source.list
Open it via your editor ( like gedit, nano, emcas)
rayyildiz@iceface:~$ sudo gedit /etc/apt/sources.list
Be sure these repo was added
deb http://us.archive.ubuntu.com/ubuntu feisty main restricted deb http://us.archive.ubuntu.com/ubuntu feisty universe multiverse
After that, you must refresh app cache and install with this command.
rayyildiz@iceface:~$ sudo aptitude update rayyildiz@iceface:~$ sudo aptitude install sun-java6-jdk
You can ensure this command which version java you are using.
java -version
If you have a few JVM environment, you have to set JVM what you want to use.
update-java-alternatives -l sudo update-java-alternatives -s java-1.6.0-sun
Again be sure which JVM version you are using by “java -version”