单元测试的目的是测试一段代码的运行结果是否正确。
How do I write a piece of code for that?
我该怎么写这块代码呢?
Again, imagine if I'm a writing a piece of code.
请再次想象一下我正在编写一段代码。
Wrapping a piece of code up in a function is called encapsulation.
用函数的形式把一段代码包装起来,叫做封装。
If you think a piece of code is confusing, write unit tests for it.
如果你觉得一段代码难于理解,那么就写一个单元测试。
The maintainability of a piece of code is arguably a matter of subjectivity.
一段代码的可维护性是个主观的问题。
Let's work through a simple example of writing a piece of code unobtrusively.
下面我们来逐步检查以低调的方式编写一个代码的简单示例。
Listing 6 gives a piece of code, which sets the data layout panel invisible.
清单6给出了一小段用来设置数据布局面板成为不可见的代码。
A mediation is a piece of code which is always associated with a destination.
中介是经常与目的地相联系的一部分代码。
Let's look at a piece of code taken from this method, which you can see in Listing 8.
让我们看看来自此方法的一段代码,参见清单8。
Scenario 5: a developer sits down to maintain a piece of code that he didn't develop.
情况5:开发人员坐下来维护不是他们开发的一小段代码。
We want to write a piece of code that helps these guys out, so I'm going to show you an example.
通过写一段代码,来解决一个这样的问题,接下来让我们来看个例子。
To begin, you must understand that an action is a piece of code that implements a predefined interface.
首先,您必须了解操作就是用来实现预定义接口的一段代码。
In open source, much of the collaboration is structured around a very tangible thing: a piece of code.
在开放源码领域,许多协作都是围绕非常具体的东西建立起来的,譬如一段代码。
Static analysis of software consists of inferring the behavior of a piece of code from its instructions.
静态分析的软件组成,推断出的一段从其指令的代码的行为。
Efficiency: the longer you are away from a piece of code, the more likely you are to forget some of the details.
效率:越长时间不接触到你的代码,你越有可能忘记其中的部分细节。
Listing 2 shows a piece of code that results in a compile-time error because the copy constructor is private.
清单2显示了产生编译时错误的代码部分,因为该拷贝构造函数是私有的。
Virtual machine interpreters typically perform certain optimizations the first time a piece of code is used.
第一次使用某个片段代码,虚拟机解释其器通常执行某些优化。
To test code that accesses hardware, you must write a piece of code that responds in a way similar to the hardware.
为了测试访问硬件的代码,必须编写一段按照与硬件相似的方式做出响应的代码。
The time the service itself takes to execute: (Note that this does not include making a dynamic call to a piece of code.)
服务本身执行所用的时间:(请注意这并不包括向代码段发送动态调用的时间。)
Up on the screen, I've got — I commented it out, but I've got a piece of code that you've seen before, right up here. OK?
我现在在大屏幕上标出来的,是你们以前看过的一段代码,就在这儿?
You can also use a WebSphere CustomService to extend the server run time itself with a piece of code that activates the MBean.
您还可以使用WebSphereCustomService和一段激活MBean的代码来扩展服务器运行时本身。
As you saw previously, a piece of code inside this PrivilegedAction should be able to ask for and get the authenticated Subject.
可以从前面看到,在这个PrivilegedAction中的一段代码应当可以请求并得到认证的Subject。
For example, if a piece of code for a service is spread across multiple modules and files, then it incurs a lot of maintenance cost.
例如,如果服务的某段代码分布在多个模块和文件中,则会带来大量的维护成本。
Real Programmers are concerned with the aesthetics of their craft; they will writhe in pain at shabby workmanship in a piece of code.
真正的程序员在他们的工作中追求美感;看一段破烂代码会让他们痛苦不堪。(我也是>:--< ——李颖注)
This technique allows people to make necessary changes to a piece of code without going through the bottleneck of an individual code owner.
这种技术可以让人们对代码片段进行必要的更改而不用经过各个代码拥有者个人的瓶颈。
Refactoring is the process of rewriting a piece of code so as to leave its execution behavior intact, but improve it in some other way.
重写一段代码保留其运行的外部特性,但在某些方面有所改进,这样的过程称之为重构。
This is actually a piece of code that is really easy to think about recursively and is much more difficult to think about in other ways.
这确实是一段用递归思考起来非常容易,而其它方法特别麻烦的代码,这一段代码的意思就是。
This is actually a piece of code that is really easy to think about recursively and is much more difficult to think about in other ways.
这确实是一段用递归思考起来非常容易,而其它方法特别麻烦的代码,这一段代码的意思就是。
应用推荐