小编Kit*_* Ho的帖子

我什么时候应该设计并记录我的测试用例?

在SDLC中,测试程序应在实施后立即进行.但是,测试驱动开发鼓励我们在实施时进行测试.在我的讲座课程中,教授说测试用例应该是设计的一部分.

我是一名初级开发人员,要实现新功能,何时应该设计并记录我的测试用例?

我发现在完成实施后测试所有案例并不是那么实际.这是因为一旦案件失败,我必须更改代码并重新测试所有案例.还有另一种方法可以克服并避免这种情况吗?我知道自动化睾丸是解决方案之一,但不知何故,自动化睾丸无法刺激所有测试用例,尤其是涉及不同方的集成测试用例.

另外,在我的测试用例中,我应该测试代码的所有部分吗?或者只测试该功能请求的功能?或者它实际上取决于你有多少时间?

非常感谢.

testing unit-testing sdlc

2
推荐指数
1
解决办法
1065
查看次数

HTML5:如何将<header>,<footer>部分设置为中心位置?

我发现,在HTML5中,我们需要使用<header>,<footer>标签,而不是<div>标签,更好的办法?

但是,我找不到任何解决方案来定位到中心位置?

谁可以帮忙?

在CSS中,

header{
???
???
}
Run Code Online (Sandbox Code Playgroud)

html5

2
推荐指数
1
解决办法
1万
查看次数

我如何捕获每个"set -x"日志到syslog?

情景就是这样

我有一个shell脚本,它运行一些带有不同参数和选项的复杂命令.

这些参数和选项由第三方应用程序传递,这样我可能无法确切知道每次向shell脚本传递的参数和选项

所以为了知道这一点,我在shell脚本的开头使用set -x来查看命令运行的确切内容.我想使用logger将那些调试器消息从set -x移动到syslog.

我用陷阱来做

trap "logger $(BASH_COMMAND)" DEBUG
Run Code Online (Sandbox Code Playgroud)

但是,syslog的输出没有正在运行的确切命令,但是......就像那样......

apple=1
orange=2
command $apple $orange
Run Code Online (Sandbox Code Playgroud)

.............................

但我想要日志的输出应该是

command 1 2 
Run Code Online (Sandbox Code Playgroud)

我怎么能实现?

bash syslog

2
推荐指数
1
解决办法
754
查看次数

Erl无法连接到本地EPMD.为什么?

erl Erlang R14B04(erts-5.8.5)[source] [64-bit] [rq:1] [async-threads:0] [kernel-poll:false] Eshell V5.8.5(用^ G中止)

[root@ip-10-101-61-85 ec2-user]# erl -sname foo
{error_logger,{{2012,12,7},{3,17,8}},"Protocol: ~p: register error: ~p~n",["inet_tcp",{{badmatch,{error,epmd_close}},[{inet_tcp_dist,listen,1},{net_kernel,start_protos,4},{net_kernel,start_protos,3},{net_kernel,init_node,2},{net_kernel,init,1},{gen_server,init_it,6},{proc_lib,init_p_do_apply,3}]}]}
{error_logger,{{2012,12,7},{3,17,8}},crash_report,[[{initial_call,{net_kernel,init,['Argument__1']}},{pid,<0.20.0>},{registered_name,[]},{error_info,{exit,{error,badarg},[{gen_server,init_it,6},{proc_lib,init_p_do_apply,3}]}},{ancestors,[net_sup,kernel_sup,<0.9.0>]},{messages,[]},{links,[#Port<0.55>,<0.17.0>]},{dictionary,[{longnames,false}]},{trap_exit,true},{status,running},{heap_size,377},{stack_size,24},{reductions,453}],[]]}
{error_logger,{{2012,12,7},{3,17,8}},supervisor_report,[{supervisor,{local,net_sup}},{errorContext,start_error},{reason,{'EXIT',nodistribution}},{offender,[{pid,undefined},{name,net_kernel},{mfargs,{net_kernel,start_link,[[foo,shortnames]]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]}
{error_logger,{{2012,12,7},{3,17,8}},supervisor_report,[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,shutdown},{offender,[{pid,undefined},{name,net_sup},{mfargs,{erl_distribution,start_link,[]}},{restart_type,permanent},{shutdown,infinity},{child_type,supervisor}]}]}
{error_logger,{{2012,12,7},{3,17,8}},std_info,[{application,kernel},{exited,{shutdown,{kernel,start,[normal,[]]}}},{type,permanent}]}
{"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}}"}

Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}})
Run Code Online (Sandbox Code Playgroud)

我在我的本地机器上工作正常但不在ec2上,我想知道它是否与网络相关的问题.我怎么检查呢?EPMD日志保持说我的连接来自非本地地址和阻止.

这会影响我的rabbitmq开始.

帮助!!〜

erlang rabbitmq

2
推荐指数
1
解决办法
2964
查看次数

如何安装ruby-augeas gem?(ubuntu 10.04)

root@ubuntu10:~# gem install ruby-augeas
Fetching: ruby-augeas-0.5.0.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing ruby-augeas:
    ERROR: Failed to build gem native extension.

        /usr/local/rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/local/rvm/rubies/ruby-1.9.3-p327/bin/ruby
    --with-augeas-config
    --without-augeas-config
    --with-pkg-config
    --without-pkg-config
extconf.rb:27:in `<main>': augeas-devel not …
Run Code Online (Sandbox Code Playgroud)

ruby ubuntu augeas

2
推荐指数
2
解决办法
3062
查看次数

在Virtual Box Ubuntu 12.04中运行Rails非常慢

我有Ubuntu 12.04的VirtualBox.我使用Vagant来设置我的环境.我在瘦(rails s)上运行Rails 3.2.9,然后从我主机上的浏览器转到VirtualBox的IP地址(10.10.11.xxx:3000).此刻我遇到麻烦 - 页面加载速度非常慢,在Rails控制台上我看到它响应文件的速度有多慢(css,js,images):每个最多5秒!但是:如果我在Ubuntu中去0.0.0.0:3000 - 它完美无缺.

Inside VM, there are two Network interface
eth0 --> it is set by Vagrant (NAT)
eth1 --> bridge, has an external IP 10.10.11.xxx
Run Code Online (Sandbox Code Playgroud)

问题出在哪儿?在哪里寻找解决方案?

人们说这与反向DNS查询问题有关.我该如何解决?有谁有想法?

virtualbox ruby-on-rails ruby-on-rails-3 vagrant

2
推荐指数
1
解决办法
2187
查看次数

Java:如何轻松更改Java中的配置文件值?

我有一个名为config.txt的配置文件,如下所示.

IP=192.168.1.145
PORT=10022
URL=http://www.stackoverflow.com
Run Code Online (Sandbox Code Playgroud)

我想用Java改变配置文件的一些值,比如将端口改为10045.我怎样才能轻松实现?

IP=192.168.1.145
PORT=10045
URL=http://www.stackoverflow.com
Run Code Online (Sandbox Code Playgroud)

在我的试用版中,我需要编写大量代码来读取每一行,找到PORT,删除原始的10022,然后重写10045.我的代码是虚拟的,难以阅读.java中有什么方便的方法吗?

非常感谢 !

java configuration

1
推荐指数
1
解决办法
7634
查看次数

start rails命令之间有什么不同?

$ RAILS_ENV=dev bundle exec rails c
Loading dev environment (Rails 4.0.4)
[1] pry(main)> exit

$ bundle exec rails c RAILS_ENV=dev
error occur...
Run Code Online (Sandbox Code Playgroud)

这两个rails启动命令有什么区别?

ruby-on-rails

1
推荐指数
1
解决办法
34
查看次数

Redis概念:在内存还是DB?

基于 http://redis.io/topics/faq

Redis是内存中的,但持久存储在磁盘数据库上。

所以我可以知道redis将键/值保存在内存或磁盘中吗?或两者?

在Redis中写入值时,它是否同时写入内存和磁盘?

谢谢你的概念。

redis

1
推荐指数
1
解决办法
579
查看次数

Bash中printf和echo之间的区别

$ printf 'apple' | wc -m
       5
$ echo 'apple' | wc -m
       6
Run Code Online (Sandbox Code Playgroud)

为什么printf打印5和echo打印6个字符?

linux bash

1
推荐指数
1
解决办法
2885
查看次数