What if my research does not give the expected results? I'm working on my Computer Science thesis. I have a two solution proposals until this moment, and I've been wondering about the following:

Sometimes you know that if you implement it correctly, it will work (eg. when building a website or a desktop app for some trivial purpose, etc), but some other times you try to solve your problem with some specific solution proposal. A few examples:


I will do some preprocessing, I'll represent the documents that way and use this metric, and then I'll apply this clustering algorithm. Theoretically, it should work.
I will use this computer vision technique for breaking the captchas, and then... In theory, it should work.


but when you implement it, you don't get the expected results (eg. bad text classification in the corpus you're using, low-rate successfuly captchas solved, etc.)

In those cases, is it a valid work? I mean, is it good to publish your work, saying that your solution proposal doesn't seem to be good when solving some specific problem?
I'm not sure what you mean by "theoretically it should work". The examples you refer to are cases where you're positing some kind of model for the data. That the experiments failed suggests that the implied model is wrong. The question then is: what is a good model, and what went wrong with the model you tried. 

It's that kind of investigation that will set you on the path to a paper.