当前位置:首页 » 软件开发
开发技术指南» 文章正文
    引言: IntroductionYou know you have to
 

 

    摘要:去除某个field有重复的行例如:$cat filename robot 3 xxx 10 @@ amyru 4 xxx 30 (& cindy 3 zzz 50 %% blue 9 yyy 30 ## 如果按域来取出唯一性的行,应该用什么 结果比如是这样,按第三个域来取就是 amyru 4 xxx 30 (& cindy 3 zzz 50 %% blue 9 yyy 30 ## ......
    摘要:转自:http://www-900.ibm.com/cn/support/nav/200402/p19-1.shtml http://www-900.ibm.com/cn/support/nav/200402/p19-2.shtml http://www-900.ibm.com/cn/support/nav/200402/p19-3.shtmllinux 下实现网卡高可用性的几种方法(一)在当前的......


ten ways to make your code more testable

introduction

many people have observed that unit testing fits the mold of heisenberg’s uncertainty principle which says, among other things, that at the quantum level, the act of observing an event changes the nature of that event. unit tests often have the same effect, but it extends beyond the runtime event being tested. it affects the design of the code that is to be tested, as well. 【程序编程相关:我的Linux起步

you know you have to write unit tests. you have the tools, and your team is committed to the idea. somehow, though, despite your best intentions, the tests just never get written. or you write them, but never run them. they always fail anyway. for one reason or another, your project is resisting the will of the unit test. usually, this means that your code needs a good solid refactoring, to make it more accepting of the way of the test. 【推荐阅读:关于linux与windows的共享

use interfaces 【扩展信息:A few Tips Of Suse

in this column, we’ll examine ten different ways you can change your code to make it ready to be tested. by doing so, you will be creating a more loosely coupled, flexible and transparent architecture, which will benefit you not only in testing but in documentation, maintenance and, eventually, modification. with a little forethought and some careful implementation, the unit tests can drive more than the qa process; it can help you design a more robust application in the first place.

those of us who came through the com days with our registries intact remember that most strident of admonitions: “it’s the interfaces, stupid”. to write com code, you had to employ interfaces as the primary coupling mechanism. for the un- (or under-)initiated, interfaces are lightweight constructs which define the publicly accessible method signatures exposed by a class; they contain no implementation details whatsoever. instantiated objects can be referred to by references of the interface type, but the interface can never be instantiated itself.

here is a simple interface example: we’ll define an interface for interacting with different kinds of agents. the interface is called iagent:

public interface iagent { string agentname {get; set;} bool accomplishmission(timespan timelimit); }

agents all have a name, and can attempt to accomplish a mission in a given amount of time.

we’ll implement two different kinds of agents, secretagents and airlineagents. airline agents perform their mission by getting people on planes, and secret agents have clandestine rendezvous’s. in addition, the secretagent, if in undercover mode, won’t reveal her name.


...   下一页
 ·performing mounts and unmounts 4-19    »显示摘要«
    摘要:performing mounts and unmounts 4-193. use the fsck command on the / (root) partition to check and repairany potential problems in the file system.# fsck /dev/rdsk/c0t0d0s04. if the fsck command is suc......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE